Changing .NET version of system references
GSmulders
Posts: 2
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
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
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?
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?
What obfuscation options are you using, if any?
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
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.
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.