Click here to Skip to main content
15,886,199 members
Articles / Desktop Programming / WPF

Extending Castle DynamicProxy

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
8 May 2010CPOL7 min read 25.7K   183   12  
Shows how to extend the proxy generated by this framework by using Reflection.Emit.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{EE444F3D-0B33-4486-9F22-6C58A4FD5F2B}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Castle.ExtensibleDynamicProxy</RootNamespace>
    <AssemblyName>Castle.ExtensibleDynamicProxy</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Castle.Core, Version=1.2.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\libs\Castle.Core.dll</HintPath>
    </Reference>
    <Reference Include="Castle.DynamicProxy2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\libs\Castle.DynamicProxy2.dll</HintPath>
    </Reference>
    <Reference Include="Castle.MicroKernel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\libs\Castle.MicroKernel.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="ExtensibleClassProxyGenerator.cs" />
    <Compile Include="ExtensibleInterfaceProxyWithoutTargetGenerator.cs" />
    <Compile Include="ExtensibleInterfaceProxyWithTargetGenerator.cs" />
    <Compile Include="ExtensibleInterfaceProxyWithTargetInterfaceGenerator.cs" />
    <Compile Include="ExtensibleProxyBuilder.cs" />
    <Compile Include="ExtensibleProxyConstants.cs" />
    <Compile Include="ExtensibleProxyFactory.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="ProxyGenerationHookAdapter.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\PresentationModelBase\PresentationModelBase.csproj">
      <Project>{1BD0EBD2-FE4F-4FB9-8A51-59AE3E089F85}</Project>
      <Name>PresentationModelBase</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Brazil Brazil
Software developer specialized in the .NET framework

Comments and Discussions