Build fails on dependency issue

cadicadi Posts: 8
edited July 21, 2010 12:53PM in SmartAssembly 5
Hi, I have been using {sa} sucessfully for over a year now to obfuscate Silverlight assemblies. Recently, the Microsoft Silverlight Tools complained about a missing patch, and forced me to install the Silverlight Tools SP1 (http://go.microsoft.com/fwlink/?LinkId=143571). Since then, {sa} fails to build, with this error message:
C:\Program Files\{smartassembly}\{smartassembly}.com ".\MyProject.{sa}proj" /output=$self 
{smartassembly} v4.0.3453
(c) 2005-2009 Cachupa
Loading project .\MyProject.{sa}proj
  Output=D:\MyProject\obj\Release\MyProject.dll
Analyzing...
ERROR: {smartassembly} has encountered an invalid token in 'MyProject.dll':

System.Void [System.Core]System.Action::.ctor(System.Object,System.IntPtr).

This means that 'D:\MyProject\obj\Release\MyProject.dll' was built with a dependency which is not the same as the one used by {smartassembly}.

You need to ensure that {smartassembly} uses the correct dependencies and try again.

What dependencies are meant here? Is this about Silverlight (my project references SL3 dlls), or about .NET ({sa} is a .NET app right)?

Any help would be appreciated - this is preventing me from releasing a critical update to my customers..

Casper
- using W2003ServerSP2, VS2008SP1, .NET3.5SP1, {sa} v4.0.3453

Comments

  • Hi.

    It's the same issue as discussed here. I'm still waiting for a fix for this too.
  • Have you tried the latest nightly build? I would have thought they would have fixed it already since it was reported before 5.1 was released.
  • @craigm: Your issue was reported over a month ago.. could you not use {sa} all this time, or did you find a workaround?

    If it really is the same issue, then it would mean that the tool is confusing the version of the .NET mscorlib it is using, with the version of the Silverlight mscorlib that my target assembly references.. :shock:

    @Eaton: Is there a possibility that I can try that build? My license does not entitle me to upgrade to 5.1 (was using the 3 and upgraded to 4). Of course I am looking into upgrading again, but in the mean time, I am hoping for a fix on the v4.0. It stopped working overnight, and I got a commercial product to obfuscate and release asap. :(

    Casper
  • cadi wrote:
    @craigm: Your issue was reported over a month ago.. could you not use {sa} all this time, or did you find a workaround?

    If it really is the same issue, then it would mean that the tool is confusing the version of the .NET mscorlib it is using, with the version of the Silverlight mscorlib that my target assembly references.. :shock:

    @Eaton: Is there a possibility that I can try that build? My license does not entitle me to upgrade to 5.1 (was using the 3 and upgraded to 4). Of course I am looking into upgrading again, but in the mean time, I am hoping for a fix on the v4.0. It stopped working overnight, and I got a commercial product to obfuscate and release asap. :(

    Casper

    Look in the EAP forum below, that is where they can be found. And I doubt Red Gate would backport a fix into an earlier version.
  • Paul.MartinPaul.Martin Posts: 83 New member
    I think this might be a slightly different problem as cadi is just using CLR2 so shouldn't have multiple different mscorlibs, although the Silverlight framework is slight strange.

    It is definitely the same cause though as SmartAssembly is having difficulty finding the correct version of the Silverlight framework libraries to use.

    Can I just confirm a few things (apologies for asking the obvious questions):
  • Eaton wrote:
    Look in the EAP forum below, that is where they can be found. And I doubt Red Gate would backport a fix into an earlier version.

    Thanks for that pointer, indeed v5.2.0.43 does build without problems, at least that is good to know :)

    Still hoping for a word from Red Gate (or the original {sa} people) on this matter though..

    Casper
  • Can I just confirm a few things [..]
    [*]Your assemblies all target Silverlight 3 and .NET 3.5?
    [*]The project built fine before you installed the update

    Did the update install anything else (for instance the Silverlight 4 runtimes as this will cause issues for v4.x)?

    You might want to try the trial of SmartAssembly 5

    Ah, I just missed this post while trying out the EAP version, sorry about that.
    - references are all SL3, nothing from .NET
    - project was fine before the update
    - machine did get a SL4 runtime installation, but the SL SDK and Tools and such are all the proper SL3
    - and yes, the official 5.1 also builds fine :D

    I will follow up with PM, thanks again for looking into this.
    Casper
  • Paul.MartinPaul.Martin Posts: 83 New member
    Glad the release version fixed it.

    Silverlight is rather odd as it doesn't install the runtime libraries side-by-side, unlike the rest of the .NET framework. This means that when you have Silverlight 4 runtimes installed and are trying to build Silverlight 2 and 3 app it has to use the framework libraries from the relevant SDKs.
    Unfortunately SmartAssembly 4.x didn't handle this stepping back to the SDKs if the Silverlight 4 runtime was installed.
Sign In or Register to comment.