1

Adding the custom control from my toolbox into a form works fine, however when I try to build the project I'm getting this error; "The type or namespace name "CustomControls" could not be found", but when I check the project's "References", I can see the CustomControls located at the very top.

k787
  • 397
  • 2
  • 5
  • 11
  • 1
    Check that the .Net version of your CustomControls assembly matches (or is compatible with) the target .Net version of your project. – Ed Guiness Jun 30 '11 at 08:57
  • hmm. I'm also getting that warning Warning The referenced assembly "CustomControls" could not be resolved because it has a dependency on "System.Design, 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. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1360 – k787 Jun 30 '11 at 08:59
  • yep, that's the problem right there. re-target your project to full 4.0 – Ed Guiness Jun 30 '11 at 09:13

2 Answers2

1

Change your project to target the full version of .Net 4.0 (not the client profile).

Ed Guiness
  • 34,602
  • 16
  • 110
  • 145
0

Also check that the custom control DLL is not platform x86 only, while you are using 'Any CPU', I once had some weird errors because of this. As for the warning you get, the following might solve your problem Where did System.Design go?

Community
  • 1
  • 1
Marking
  • 754
  • 1
  • 8
  • 23