Russell Lewis
Russell Lewis

Reputation: 23

C# WPF clr-namespace autocompletes but then gives error

So I have reverenced a class with a custom Listbox See at the bottom of the picture... image 1 enter image description here I have referenced this class with xmlns:local="clr-namespace:DynamicPorts"

When I go to use the object in my XAML it offers my class in the autocomplete (so it knows it is there!!!) but as soon as it ive typed it i get an error and my project wont build...

image 2

enter image description here

What am I doing wrong??

Thanks in advance

Upvotes: 2

Views: 67

Answers (1)

loopedcode
loopedcode

Reputation: 4893

Make sure your project is referencing same version of the framework as well as same profile as your referenced DLL (DynamicPorts.dll). If your project is using "4.0 Client Profile" and the referenced assembly is using full "4.0" and has dependency on full 4.0, then your project won't be able to access the reference at run/build time.

Please see MSDN on this targeting error under the section "You Have Referenced an Assembly That Is Not Included in the Client Profile"

Upvotes: 1

Related Questions