Windows Form app being treated like a Silverlight app

DevInnDevInn Posts: 7
edited November 25, 2010 5:34AM in SmartAssembly 5
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!


  • 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.
Sign In or Register to comment.