Changing .NET version of system references

GSmuldersGSmulders Posts: 2
edited March 29, 2012 11:29AM in SmartAssembly
Hi,

I have been working in a .NET 4 library project in C#.
Unfortunately, by request of the client, I have changed the Target Framework to .NET 3.5

Now I've got the problem that, after Smart Assembly builds the assembly the referenced System resources are in .NET version 4.
Before building the assembly, the references are set to .NET version 2
Because of this problem, I cannot use the regasm of .NET 2 to register the assembly.

Does anyone know what I'm doing wrong and if there's a workaround for this?

Sincerely,

Geert-Jan
Tagged:

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello Geert-Jan,

    I can't find any record of SmartAssembly breaking an assembly in this way. Just to confirm, which system resources are you talking about, and how do you know they are still in the v4 format?
  • UrosUros Posts: 3 New member
    edited May 13, 2019 3:04PM
    Hello,

    sorry for bringing this topic from the dead, but I'm experiencing the similar issue with the latest SmartAssembly 7.0.3.2212.

    The simplest way I managed to reproduce this:

    Create new C# class lib targeting .NET 3.5.
    Add reference to System.Windows.Forms.
    Add a dummy Windows Form.

    The obfuscated assembly has it's references changed from 2.0 to 4.0 runtime for no apparent reason.
    See this (reflected using dotPeek):



    For reference, here is the same project in VS2017:



    The problem resolves when I remove the ref to System.Windows.Forms but that is not really a solution.
    Is there any workaround for this issue?
  • Russell DRussell D Posts: 1,093 Diamond 3
    I can't reproduce this I'm afraid, I get the correct version numbers.
    What obfuscation options are you using, if any?
    Have you visited our Help Centre?
  • UrosUros Posts: 3 New member
    edited May 20, 2019 2:07PM
    Hi Russell,

    Here is the entire project along with .saproj.
    Just build Release and it will call SA 7 in post build event.

    Also worth mentioning, since I'm doing this on a test machine, I'm using Personal (Trial) version of SA.

    Best regards
  • Russell DRussell D Posts: 1,093 Diamond 3
    edited May 23, 2019 8:54AM
    Thanks for the reproduction. I couldn't reproduce this at first, but then noticed I'd 7.0.2 installed. So that was stupid of me, sorry.



    Upgraded to 7.0.4 and bang there it is, so it looks like we introduced this in 7.0.3. I've raised an internal issue, SA-2171.
    Have you visited our Help Centre?
  • Russell DRussell D Posts: 1,093 Diamond 3
    Ok upon further investigation this is down to the personal edition, if you build a release you won't see this issue.

    This requires us to update the licensing within SA, which is something we are currently working on but will take some time. This will fix a number of issues though.
    Have you visited our Help Centre?
  • UrosUros Posts: 3 New member
    Ok, thank you for the clarification. Glad you managed to reproduce it internally.
Sign In or Register to comment.