Mscorlib assembly name has not been set
shane_russo
Posts: 7 New member
When running build in smartassembly to obfuscate a dll, I am getting the following in the SmartAssembly.log file:
2016-10-10 11:14:15,047 INFO SmartAssembly.ProcessingProject: Preparing
2016-10-10 11:14:15,063 INFO SmartAssembly.ProcessingAssembly: Indexing assemblies...
2016-10-10 11:14:15,594 INFO SmartAssembly.ProcessingAssembly: Merging assemblies...
2016-10-10 11:14:15,594 INFO SmartAssembly.ProcessingAssembly: Merging C:ProjectsworkDiaryMateWDMWDMWDMinDebugWDM.dll
2016-10-10 11:14:16,110 INFO SmartAssembly.ProcessingAssembly: Merging types...
2016-10-10 11:14:16,407 INFO SmartAssembly.ProcessingAssembly: Updating method bodies...
2016-10-10 11:14:16,422 ERROR SmartAssembly.ProcessingProject: Mscorlib assembly name has not been set
System.InvalidOperationException: Mscorlib assembly name has not been set
I have tried putting the following in my project file:
<Assembly AssemblyName="mscorlib, Culture=neutral, PublicKeyToken=b77a5c561934e089" mandatorypath="C:WindowsMicrosoft.NetassemblyGAC_32mscorlibv4.0_4.0.0.0__b77a5c561934e089mscorlib.dll">
<Merging />
but still get the same error.
I have not come up with a solution to this yet. Any suggestions?
2016-10-10 11:14:15,047 INFO SmartAssembly.ProcessingProject: Preparing
2016-10-10 11:14:15,063 INFO SmartAssembly.ProcessingAssembly: Indexing assemblies...
2016-10-10 11:14:15,594 INFO SmartAssembly.ProcessingAssembly: Merging assemblies...
2016-10-10 11:14:15,594 INFO SmartAssembly.ProcessingAssembly: Merging C:ProjectsworkDiaryMateWDMWDMWDMinDebugWDM.dll
2016-10-10 11:14:16,110 INFO SmartAssembly.ProcessingAssembly: Merging types...
2016-10-10 11:14:16,407 INFO SmartAssembly.ProcessingAssembly: Updating method bodies...
2016-10-10 11:14:16,422 ERROR SmartAssembly.ProcessingProject: Mscorlib assembly name has not been set
System.InvalidOperationException: Mscorlib assembly name has not been set
I have tried putting the following in my project file:
<Assembly AssemblyName="mscorlib, Culture=neutral, PublicKeyToken=b77a5c561934e089" mandatorypath="C:WindowsMicrosoft.NetassemblyGAC_32mscorlibv4.0_4.0.0.0__b77a5c561934e089mscorlib.dll">
<Merging />
but still get the same error.
I have not come up with a solution to this yet. Any suggestions?
Comments
Just to confirm--are you protecting a Portable class library that targets .NET Framework 4.5 or higher?
I'm afraid that SmartAssembly doesn't support this at the moment. The issue is that SmartAssembly expects that an assembly will always have a valid mscorlib reference, and PCL libraries targeting .NET 4.0.3 and below did actually have an mscorlib reference, but those targeting .NET 4.5+ instead end up referencing System.Runtime (as all mscorlib types are forwarded to this assembly).
I know this is not ideal, but the only way around this that I've found is to have an assembly also target Silverlight (which will add an mscorlib reference).
Very sorry as I know this is not the answer you were hoping for! Please let us know if you have any other questions at the moment.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
I don't think I can target Silverlight as I need to target ASP.NET Core 1.0 in my project.
Do you have any other workarounds and do you have an ETA for this to be fixed?
Thanks
Shane
I'm so sorry to say that there is no other workaround at the moment and we don't have an ETA as of yet as there haven't been many other reports so far from others working with PCLs.
Sincere apologies for any troubles this causes and if it makes SmartAssembly unusable for this project!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
We are also seeing this issue here.
Also, if your main assembly has a reference to a PCL that also has reference to another PCL, Smart Assembly just disappears midway through the build process. There is no error message or Event Log entry.
C