Third Party Integration - Using PostSharp with Loupe - Getting Started
In This Topic
To take advantage of the Loupe Agent for PostSharp you need to:
- Add the Loupe Agent for PostSharp to every project that has classes you want to instrument using the agent. This will both add the Loupe Agent if it hasn't been already and add PostSharp.
- Add the Loupe Agent to your executable and configure following the relevant guidance based on your application type.
- Add one or more of the Aspects provided by the Agent to your classes - either explicitly on a class or method or via attribute multicasting.
Using PostSharp with Web Sites
Because PostSharp extends the application compilation process to weave together your source code and external aspect libraries (like the Loupe Agent for PostSharp) it requires that the application be precompiled. There are two types of ASP.NET applications you can develop in Visual Studio:
- ASP.NET Web Sites: There is no project file, every file is compiled as needed and all of the libraries in the bin directory are loaded at runtime.
- ASP.NET Web Applications: These have a project file, explicit project references and function more like traditional .NET assemblies. These are partly to completely compiled for distribution.
PostSharp is not supported with ASP.NET Web Sites. You can convert your Web Site project to a Web Application project and then use PostSharp without issue.
We encourage you to use web application projects instead of web site projects in general, and this is required to use PostSharp. Other Loupe functionality works for both.
Deploying your Application
For complete information on what assemblies to deploy with your application see Third Party Integration - Using PostSharp with Loupe - Deployment.
Where To Next?
We encourage you to review the Best Practices for using PostSharp with Loupe for guidance on what aspects to use at different phases of your development project.
See Also