SharpCrafters Forum – Updating to PostSharp 1.5 CTP

SharpCrafters Support Forum

        

12»»

Updating to PostSharp 1.5 CTP Expand / Collapse
Author
Message
Posted 10/17/2008 11:32:02 AM


Community Member
Hi

I'm a new PostSharp'er and I am interested in using Log4PostSharp with the latest CTP release.  I got the code from svn but on compiling I'm encountering a problem due to missing types that are now not available in PostSharp 1.5.  The specific type that is missing is the CustomAttributeDictionaryTask.   Are there any plans to update this to work with v1.5?  If not, can someone point me in the right direction for getting this to work with the CTP.

Thanks
Carel
Post #3356
Posted 10/19/2008 5:25:49 PM


Michal Dabrowski

Community Member
Hi,

I wasn't aware of this issue. I will recompile the Log4PostSharp against the PostSharp 1.5 in few days.
Post #3357
Posted 10/20/2008 2:37:55 PM


Gael Fraiteur

SharpCrafters
Yup, there are some incompatibilities. It may be necessary to maintain two branches of the project.

-gael
Post #3358
Posted 5/14/2009 6:57:17 AM


Community Member
Hi
Could you please notify in this thread when you build it against 1.5?
Thanks
Adiel
Post #3359
Posted 5/26/2009 7:33:54 AM


Community Member
I would also be interested in this.
Post #3360
Posted 5/27/2009 10:50:58 AM


Community Member
Any news on update?
Post #3361
Posted 6/3/2009 7:25:44 PM


Community Member
Hi Folks.
I have just upgraded to PS1.5 and noticed log4PostSharp stopped to build. So, I upgraded it as well.
I would like to share it with the community.
We have also augmented Log4PostSharp with several useful features - see my post here - http://www.postsharp.org/forum/log4postsharp/specifying-logger-for-log4postsharp-t391.html
If anyone is interested my e-mail is
mark dot kharitonov at (do not spam please) gmail dot com
Post #3362
Posted 6/3/2009 7:29:54 PM


Gael Fraiteur

SharpCrafters
Markell,

Do you want me to give you access to the source repository?

-gael
Post #3363
Posted 6/10/2009 1:16:50 PM


Community Member
Sure, I will be glad to.
How do I commit our modifications?
Post #3364
Posted 6/10/2009 2:08:27 PM


Gael Fraiteur

SharpCrafters
You now have access to <!-- m --><a class="postlink" href="http://code.google.com/p/postsharp-user-plugins">http://code.google.com/p/postsharp-user-plugins</a><!-- m -->.

Use an SVN client (TortoiseSVN) to upload your changes.

Do it this way:

1. Check out the project using the HTTPS protocol (HTTP would give you read-only access).
2. Branch trunk/1.0/Log4PostSharp into trunk/1.5/Log4PostSharp
2. Using WinMerge, merge your changes into your working copy of trunk/1.5/Log4PostSharp.
3. Commit trunk/1.0/Log4PostSharp to the source control.

-gael
Post #3365
Posted 6/10/2009 3:12:53 PM


Community Member
I will surely do so, however, there is one file in PostSharp.Core that have a tiny bug in it, which must be fixed to support our modifications.
Here is the differences as unified diff (mind the spaces):
[size=85]
Index: C:/Dev/internal/GenericParameterTypeSignature.cs
===================================================================
--- C:/Dev/internal/GenericParameterTypeSignature.cs (revision 80)
+++ C:/Dev/internal/GenericParameterTypeSignature.cs (revision 83)
@@ -265,7 +265,7 @@
    switch ( this.kind )
    {
        case GenericParameterKind.Method:
-            if ( genericMethodArguments == null )
+           if ( genericMethodArguments == null || genericMethodArguments.Length == 0 )
           {
              reflectionType = null;
           }
@@ -276,7 +276,7 @@
           break;

        case GenericParameterKind.Type:
-           if ( genericTypeArguments == null )
+           if ( genericTypeArguments == null || genericTypeArguments.Length == 0 )
           {
             reflectionType = null;
           }
[/size]

Without this fix, using the message formatters we haved added to the LogAttribute crashes the instrumentation process.
Do you want me to commit our changes now anyway?
Post #3366
Posted 6/11/2009 6:32:57 AM


Community Member
OK, I have committed to the trunk.
The final commit log message is:
1. Upgrade to PostSharp 1.5
2. Added LoggerPolicyAttribute and LoggerAttribute
3. Added {inparamvalues} and {outparamvalues}
4. Added LogAttribute.IncludeParamName property.
5. Changed the default values of the LogAttribute properties.

We have changed the default values, so that specifying just [Log] produces reasonable log message. However, the GenericParameterTypeSignature.cs file needs to be fixed, until then using the new version will crash.
Regards,
Post #3367
Posted 6/11/2009 6:34:53 AM


Community Member
One more thing. A new project is added to the Log4PostSharp solution  - an mstest project unit testing the new attributes - LoggerAttribute and LoggerPolicyAttribute.
Post #3368
Posted 6/12/2009 5:42:35 PM


Gael Fraiteur

SharpCrafters
Thank you for this work!

Please report the problem with GenericParameterTypeSignature.cs  to the issue tracker otherwise I'll forget about it.

Thanks,

-gael
Post #3369
Posted 6/12/2009 6:05:53 PM


Community Member
Done.
Post #3370
Posted 6/23/2009 11:36:01 AM


Community Member
Gael, thanks for the fix. Now I know how to do it efficiently.
However, the old code, albeit inefficient, was still legitimate and the fact that it crashed indicates some kind of a problem.

Anyway, we have fixed a bug in the LoggerPolicyAttribute, which prevented it from being multicast on all the types in an assembly. The bug was that we instrumented the special <Module> type, which was not good. It is fixed now, I have committed the fix.
Hope it is OK.
Post #3371
Posted 6/23/2009 11:44:10 AM


Gael Fraiteur

SharpCrafters
Gael, thanks for the fix. Now I know how to do it efficiently.
However, the old code, albeit inefficient, was still legitimate and the fact that it crashed indicates some kind of a problem.


No, the code was wrong. Either you pass null to this method, either you pass a valid array of types of the proper size (i.e. the calling code should have passed null instead of EmptyTypeArray). This is by design. Maybe just poorly documented.


Anyway, we have fixed a bug in the LoggerPolicyAttribute, which prevented it from being multicast on all the types in an assembly. The bug was that we instrumented the special <Module> type, which was not good. It is fixed now, I have committed the fix.
Hope it is OK.


It should be.

I could blog about this plug-in being upgraded once you feel it's ready.

-gael
Post #3372
Posted 6/24/2009 6:46:53 AM


Community Member
Oh, I get it now. I guess I was fooled by the fact that passing null did not throw ArgumentNullException and it actually worked in some scenarios. Well, thanks for the explanations.

I think we are through with our modifications. I have just committed several unit tests for the LogAttribute to unit test the new templates.
So, go ahead.
Post #3373
Posted 6/24/2009 7:05:40 AM


Gael Fraiteur

SharpCrafters
Could you post a build to <!-- m --><a class="postlink" href="http://code.google.com/p/postsharp-user-plugins/downloads/list">http://code.google.com/p/postsharp-user ... loads/list</a><!-- m --> before I blog?

Thanks.

-g
Post #3374
Posted 6/24/2009 10:01:38 PM


Community Member
Hi Gael.
I have built and tested everything. However, Log4PostSharp assemblies are not signed at all.
I have never downloaded PostSharp binaries, but I guess that you make them strongly signed as opposed to delay signed as in the source distribution in order to preserve the same public key.
I think the same should be true for the Log4PostSharp assemblies. So, unless I should delay sign them with the PostSharp public key I need a dedicated Log4PostSharp public key. I will build the binaries and you will complete their signing with the private key your will own.
Does it make any sense?
Post #3375
« Prev Topic | Next Topic »

12»»

All times are GMT +1:00, Time now is 2:26am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.127. 12 queries. Compression Disabled.