Tigraine

Daniel Hoelbling-Inzko talks about programming

Weird errors with .NET Framework Client Profile referencing Full Profile Assemblies

Posted by Daniel Hölbling on September 5, 2010

I am currently working on a little demo project with NServiceBus and ran into this so I thought I’d share it:

If you create a new WPF project in VS2010 it will target by default the .NET FX Client Profile. That’s nice for a  number of reasons, but you will see very weird behavior once you reference an assembly that requires the full .NET profile.

In my case it was NServiceBus that I was referencing. Although the using directives where there, and I got full IntelliSense (and the reference showed up in VS) I got this compile error:

image

The code in question looks innocent:

image

Well: The reason for this weirdness is the .NET Client Profile. NSB requires stuff that’s not in the Client Profile thus the compiler will not resolve the reference. Visual Studio has no clue about that and isn’t displaying meaningful errors.

The solution is obviously simple: Go to the project preferences and select the appropriate Target framework:

image

Hope this helps!

Filed under net, programmierung
comments powered by Disqus

My Photography business

Projects

dynamic css for .NET

Archives

more