Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Recently I surfaced a problem where, one of my friend had a tough time in getting rid of an assembly reference error.  Despite adding reference to the assembly, while referencing it in code, it was spitting out the “The type or namespace name ‘ASSEMBLYNAME’ could not be found” error.   This was a migration project and owing to the above error, it was throwing another 100 errors.

We tried adding reference to the assembly in other projects and it was not even resolving the namespace while typing out in the using section.

Upon further digging into the error warnings, it indicated something to do with the .NET Framework targeted i.e. 4.0.  My suspicion grew since the target framework was 4.0 and the assembly should be able to be recognized. 

Then, when we checked “Project – “<APPNAME> Properties…”, the issue was with the default target framework which is “.NET Framework 4 Client Profile”

image

By default, Visual Studio 2010 creates Windows Forms App/WPF Apps with the Target Framework set to .NET Framework 4 Client Profile.  This is to minimize the framework size required to be bundled along with the app. Client Profile is new feature since .NET 3.5 SP1 that allows users to package a minified version of .NET Framework that doesn’t include stuff such as ASP.NET, Server programming assemblies and few other assemblies which are typically never used in the Desktop Applications.

Since the .NET Framework client profile is a minified version, it doesn’t contain all the assemblies related to Web services and other deprecated assemblies.  However, this application is a migration app and needed some of the references from Services and hence couldn’t run.

Once, we changed the Target Framework to .NET Framework 4 instead of the default client profile, the application compiled.

Here is link to a very nice article that explains the features of .NET Framework 4 client Profile, the assemblies supported by default etc., http://blogs.msdn.com/b/jgoldb/archive/2010/04/12/what-s-new-in-net-framework-4-client-profile-rtm.aspx

Cheers !!

Print | posted on Monday, May 24, 2010 10:39 PM

Comments on this post

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
thanks for posting this, it solve my problem.
Left by derek on May 27, 2010 3:24 AM

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
Yes, after hours of pulling my hair out, I came across your solution. Thanks for sharing.
Left by Gordon on May 28, 2010 12:33 PM

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
I found this post via yahoo. THANKS!
This seems to be the typical problem that can take ten minutes to fix or ten hours to fix (or ten days), depending on whether or not you get lucky. It's isn't a hard fix... it's just a matter of figuring out the problem! Steve
Left by steve on Jul 12, 2010 8:08 AM

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
The essential tool for individuals performing basic development tasks. Visual Studio 2010 Professional simplifies the creation,these new addition is tremendous and have useful features for us.
Left by frequent urination in women on May 27, 2011 11:27 AM

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
this is a great articles , i love it , will follow your blogs all the time, thanks
Left by replica shoes online on Jun 25, 2011 2:27 PM

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
"That's awesome.
I'm so glad you started blogging and that I can call you my friend.
Keep posting and I'll keep reading."

Left by botpr on Sep 01, 2011 2:13 PM

# re: Visual Studio 2010 Winform Application – Unable to resolve custom assemblies?

Requesting Gravatar...
I know that there are a lot of spam bots out there that say, things like "Awesome! Thanks!"

But... Awesome! Thanks!

This and the follow-up post were exactly what I needed to start using the MailDefinition class.
Left by Patrick on Aug 02, 2012 1:27 AM

Your comment:

 (will show your gravatar)