Windows Form app being treated like a Silverlight app

.NET obfuscator and automated error reporting

Windows Form app being treated like a Silverlight app

Postby DevInn » Sun Nov 21, 2010 7:42 pm

I'm evaluating SmartAssembly 5.5 and trying to do a simple obfuscation. It appears that SA thinks my Windows Form application (.Net 4.0) is a Silverlight application. There are several options that are grayed out and say 'this option is not available for Silverlight applications.' and when I'm trying to build, it is failing saying 'The most likely cause is that SA has used a different version of the dependency...' Dependency found at: C:\\Program Files (x86)\\Microsoft Silverlight\\4.0.50917.0\\mscorlib.dll'. Not sure why SA thinks it should be looking in the Silverlight directory since it is a Windows Forms application...

Any help would be appreciated. Thanks!
Posts: 5
Joined: Sun Nov 21, 2010 7:25 pm

Postby Linda Hawksworth » Thu Nov 25, 2010 10:34 am

The .NET version detection hinges on the version of the referenced mscorlib.

case "": Token targetFrameworkVersionAttribute = FindAttributeByFullName("[mscorlib]System.Runtime.Versioning.TargetFrameworkAttribute");
if (targetFrameworkVersionAttribute.IsEmpty)
clrVersion = CLRVersion.SilverlightV2or3;
clrVersion = CLRVersion.SilverlightV4;

Would you try opening your assembly up in .NET Reflector (you can download a free 14 day trial version from our website - and check the mscorlib and TargetFramework attribute (use search to find the latter). If mscorlib reference is version and the TargetFramework attribute doesn't exist, SA thinks it's silverlight. We are also aware that some assemblies can have two references to mscorlib as well which can cause problems. Make sure you are referencing Microsoft.CSharp.dll of version and not which would account for the mscorlib of Silverlight.
Linda Hawksworth
Posts: 192
Joined: Mon Jun 25, 2007 10:32 am

Return to SmartAssembly 5

Who is online

Users browsing this forum: No registered users and 0 guests