postsharp

What are the disadvantages of using this asynchronous logging code?

Some code I just wrote follows. It demonstrates applying a PostSharp aspect to a method for the purposes of recording the duration of the method invocation in an asynchronous manner - so that if the logging process is slow then this performance penalty is not seen by the caller of the method decorated with the aspect. It seems to work...

Can you call a class member from within a PostSharp advice?

So I'm working with PostSharp to pull out boilerplate logging/exception handling code so that this: public void doSomething() { Logger.Write("Entered doSomething"); try { // code } catch (Exception ex) { ExceptionPolicy.HandleException(ex, "Errors"); } Logger.Write("Exited doSomething");...

PostSharp 1.5 and .Net 4

Postsharp is great, but only the 1.5 version is still opensource. Does it work with .net 4.0? If not, are there any other good AOP weavers out there? I'm not interested in the proxy type. ...

Log4Postsharp (dead?) with postsharp 2.0 or drop for ELMAH ?

Hi there, Does anyone know if the latest build (march 2010 - i beleive called log4postsharp 2.0) is compatible with postsharp 2.0 community edition? I have used postsharp 1.5 together the log4postsharp in the past and was very pleased with the outcome. But log4postsharp seems to be dead, is this true? SHould i concentrate more on ELM...

can't weave, please help

Need to modify Log4PostSharp project by inheriting from the ready-made (and working) custom attribute. It looks similar to this: [AttributeUsage( AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Struct, AllowMultiple = true,...

PostSharp access to original attribute markup string parameter

I have a POstSHarp attribute implementing OnMethodBoundaryAspect. The mark up is as follows: [ExceptionLogging("RepositoryLayer")] What I want to do within the implementation of the aspect is access the string that was passed with the attribute markup above. The idea is that based on this value I can see (in a very rudimnentary manner...

PostSharp - What am I doing Wrong?

Hello, I have a project Company.Business that I'm trying to target with PostSharp to wrap my business layer. In the project Company.AOP, I have a method boundary aspect to use EL logging application block as such: [Serializable] public class MethodExcecutionAttribute : OnMethodBoundaryAspect { public override void OnEntry(MethodEx...

Postsharp: StoredFieldValue is null

I am using Postsharp, i have this aspect (lets call it AspectA) that implements OnFieldAccessAspect. Then i have a field: [AspectA] private object fieldA; When i set fieldA value the first time: fieldA = objectX; In OnSetValue, i have eventArgs.StoredFieldValue == null and eventArgs.ExposedFieldValue== objectX, this is what i ex...

Postsharp 2.0 Aspects not firing with .net 3.5 and visual studio 2008

Hi, I recently upgraded to the postsharp 2.0 community edition, and my postsharp aspects are not firing. Is this a known issue? Mike ...

Incrementing AverageTimer32 performance counters

I'm moving some instrumentation into PostSharp aspects, basically the code which is incrementing the timing counters looks something like the following: MyPerformanceCounter.IncrementBy(elapsed); MyPerformanceCounterBase.Increment(); This works fine and I see the correct values getting updated in Perfmon (MyPerformanceCounter is an Av...