I'm trying to use a PostSharp aspect in a website project in VS2012. It seems to work fine when I set up a web application project, but when I apply the aspect attribute to a method on a page in the website project it compiles and runs fine, but my OnMethodBoundaryAspect never gets hit. I tried setting breakpoints and logging from the aspect methods.
Does PostSharp support website projects? if so, what am I missing?
Please no comments about why I want to use a website instead of a web app. Unfortunately it is a requirement (don't ask).
This is my aspect code (all in vb.net), but like I said, it works fine on a web app project:
Imports PostSharp.Aspects
Namespace TestAopLib
<Serializable>
Public Class AopTester
Inherits OnMethodBoundaryAspect
Public Overrides Sub OnEntry(args As MethodExecutionArgs)
MyBase.OnEntry(args)
Debug.WriteLine("In OnEntry")
End Sub
Public Overrides Sub OnExit(args As MethodExecutionArgs)
MyBase.OnExit(args)
Debug.WriteLine("In OnExit")
End Sub
Public Overrides Sub OnSuccess(args As MethodExecutionArgs)
MyBase.OnSuccess(args)
Debug.WriteLine("In OnSuccess")
End Sub
Public Overrides Sub OnException(args As MethodExecutionArgs)
MyBase.OnException(args)
Debug.WriteLine("In OnException")
End Sub
End Class
End Namespace