Red Gate forums :: View topic - Windows Form app being treated like a Silverlight app
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Windows Form app being treated like a Silverlight app

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
DevInn



Joined: 21 Nov 2010
Posts: 5

PostPosted: Sun Nov 21, 2010 8:42 pm    Post subject: Windows Form app being treated like a Silverlight app Reply with quote

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!
Back to top
View user's profile Send private message
Linda Hawksworth



Joined: 25 Jun 2007
Posts: 192

PostPosted: Thu Nov 25, 2010 11:34 am    Post subject: Reply with quote

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

case "2.0.5.0": Token targetFrameworkVersionAttribute = FindAttributeByFullName("[mscorlib]System.Runtime.Versioning.TargetFrameworkAttribute");
if (targetFrameworkVersionAttribute.IsEmpty)
{
clrVersion = CLRVersion.SilverlightV2or3;
}
else
{
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 - www.red-gate.com) and check the mscorlib and TargetFramework attribute (use search to find the latter). If mscorlib reference is version 2.0.5.0 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 4.0.0.0 and not 2.0.5.0 which would account for the mscorlib of Silverlight.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group