C # Winforms Designer will not open because it cannot find the type in the same assembly

I get the following error

Could not find type "My.Special.UserControl". Make sure that the assembly containing this type is referenced. If this type is part of your development project, make sure that the project has been successfully created using the settings for your current platform or any processor.

But it makes no sense that it My.Special.UserControlis in the same assembly as the form. What else, if I look at the code in the Designer.cs file, there are links to ones My.Special.UserControlthat seem accurate. Assembly builds great and works great. This is just a designer having problems.

Therefore, we must carry out all our design work by manually editing the Designer.cs file. How can I get a designer to work again?

+10
source share
9 answers

The following procedure worked for me:

  • Delete the / bin and / obj folders in the source directory.
  • Restart VS (make sure the intruder is closed)
  • Compile
  • Open the form again in Designer. The problem must be resolved.

I am sure that removing / bin and / obj is not necessary, but I could not reproduce the error and move on to a more specific solution. (My projects are usually small enough to recompile it all doesn't really matter.)

/ -. , VS, User Control Custom Control.

+4

, /UserControl. - ?

Visual Studio Visual Studio, . , - .

+3

+1

x86

+1

. , , Vs . , , , , - VS.

, , , , . , , .

, - VS, .


, , SO, , - .

0

.resx , , . ....

0

, .NET . cs. ( x64 - , x64).

, "Utils" . !

0

Git .

, .

0

, VS 2017 .

  1. VS
  2. Go to project folder
  3. Delete the .vs folder. Make a backup if you need to.
  4. Start VS

This should solve the problem.

0
source

All Articles