PostSharp with SharpDevelop

SharpDevelop3.0 uses MSBuild. Including PostSharp in your build process is transparent if you are doing a global install using PostSharp installer. If you are doing a per-project installation using “Binary – No Installer” download, you will need to import the PostSharp targets into your .csproj file –


    True

C:\code\PostSharp-1.0.8.316-Binary\

For more details, read the install instructions included in the PostSharp download and under-the-hood-of-msbuild-integration.

To use local PostSharp binaries (relative to your project) , modify your .csproj file as follows –

  
    True
    $(MSBuildProjectDirectory)\PostSharp\
  
  
  
  
    

$(MSBuildProjectDirectory) is the directory containing your .csproj file.
\PostSharp\ is the directory containing local PostSharp binaries.

2. You will need to exclude the Aspect class itself from being woven.

If you are following the getting-started sample, see the following example:

[Serializable]
[Trace( null, AttributeExclude = true )]
public sealed class TraceAttribute : OnMethodBoundaryAspect
{

3. Compile your project.