New Posts New Posts RSS Feed: Migration to DF 7.2 and Postsharp 3
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Migration to DF 7.2 and Postsharp 3

 Post Reply Post Reply
Author
kdev View Drop Down
Groupie
Groupie
Avatar

Joined: 03-Jan-2013
Posts: 83
Post Options Post Options   Quote kdev Quote  Post ReplyReply Direct Link To This Post Topic: Migration to DF 7.2 and Postsharp 3
    Posted: 10-Jul-2013 at 1:20pm
Hi,

I spent my day trying to migrate my solution from the previous version of DF & Cocktail to the newest one.

Postsharp throw an exception during the compilation and I have no clue why since all was working before.

I get this error for every .xaml file located in the different Silverlight Application of my solution :

Could not load file or assembly 'PostSharp, Version = 3.0.31.3, Culture = neutral, PublicKeyToken = b13fd38b8f9c99d7' or one of its dependencies. The specified file was not found.
File : xxx.xaml

Currently, only my Domains (.net & .SL) have the Ideablade.AOP and Postsharp refercence. So why do I get this error on the views ?
The references looks correct in my Domain's csproj.

I did look in the log (mode diagnostic) but it was no help.

Have you experienced such problem ?

Regards
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jul-2013 at 2:08pm
In the Domain projects, did you update PostSharp to the latest 3.0.31?
Can you double check if PostSharp package is not really installed in the views projects?
Back to Top
kdev View Drop Down
Groupie
Groupie
Avatar

Joined: 03-Jan-2013
Posts: 83
Post Options Post Options   Quote kdev Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jul-2013 at 2:54pm
Hi Silvio,

Yes I double checked, I have no references to Postsharp in projects hosting the views.

As for the Domain they are using postsharp 3.0.31. No reference to postsharp 2.1.* are left in the projects.
Back to Top
kdev View Drop Down
Groupie
Groupie
Avatar

Joined: 03-Jan-2013
Posts: 83
Post Options Post Options   Quote kdev Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jul-2013 at 4:40am
Hi,

I managed to modify TempHire to get this error (uploads/1623/TempHire.zip)

I added 2 libraries, DomainBase and DomaineBase.SL to host the EntityBase class (this is actually how my project looks like).
The references to Devforce&Postsharp on DomainBase.SL are set to CopyLocal = False.

If you build this project, the first build might success but the next  build will fail.


The problem seems to be related to CopyLocal = False in this architecture !


About my project : it discover modules at runtime, each module having his own model. Each model inherit of this DomainBase class to share the EntityBase.
To reduce the size of the XAP, I set copy local = False to every module containing in a module XAP. Only the Main application have the CopyLoca  = true on  Devforce and Postsharp. That way I donwload Defvorce libraries only once.




Edited by kdev - 11-Jul-2013 at 4:43am
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jul-2013 at 6:40pm

When an SL project containing XAML is built there's a step called MarkupCompilePass1 which tries to compile the xaml.  It doesn't do a very good job resolving references to dependent assemblies and will raise this error.  We've seen this problem in WPF projects too.  I'm not sure why you weren't also seeing it when using PostSharp 2.0.

Setting CopyLocal=true is one fix, as that will allow the compile to work, at the cost of the increased XAP size.
 
Another workaround is to add the PostSharp.dll assembly reference, with CopyLocal=false, to your UI project(s).  You only need to add the assembly reference, not install the PostSharp package to the project.
Back to Top
kdev View Drop Down
Groupie
Groupie
Avatar

Joined: 03-Jan-2013
Posts: 83
Post Options Post Options   Quote kdev Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2013 at 12:31am
I don't see how I can add the reference to postsharp wihtout adding the nuget package to the project if I want it to be updated on the future DF releases.

Anyway I will try this workaround thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down