VS2010: WinForms defaults to 4.0 “Client Profile”

Alright, so I gave away the punch-line right in the title – but hey, I’m not out to waste anyone’s time, I’ll get right to the point!

OK, so I have a WinForms app that references a .dll that happened to have a reference to System.Web. Because of this, I get a build warning of:

C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1360,9): warning MSB3253: The referenced assembly "K:DatablahbinDebugblah.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

and because of this warning, my WinForms app wouldn’t build because it couldn’t successfully reference this .dll. In other words, if I added a project reference, I can see everything in the .dll project – but as soon as I attempted to build the WinForms project, all the code would break and it would say that it couldn’t find the objects from the .dll – even though they were there a second ago! I’d re-add project reference and it would happen again.

Eventually, I saw the warning in the output window – so, in the WinForms project, sure enough:

image

I didn’t notice the warning in the build output at first, so I blew about 20 minutes trying to troubleshoot why this reference would work and then seemingly “unlink” when I went to run the app. So, I thought I would pass this on…

Posted in .NET 4.0, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2 other followers

%d bloggers like this: