I have a large solution, say 60-ish projects. One of the project is a library that contains controls.
One of the controls it contains is a textbox class derived from TextBox, e.g.,
using System;
using System.Windows.Forms;
namespace MyNamespace
{
public class MySpecialTextBox : TextBox
{
}
}
When I open the form on which I've placed an instance of this control in the past (when the Designer was somehow working), I now receive the error message screen "To prevent possible data loss before loading the designer, the following errors must be resolved:"
"Could not find the type 'MyNamespace.MySpecialTextBox.' Please make sure that the assembly that contains the type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU."
What I have tried:
When I open the form on which I've placed an instance of this control in the past (when the Designer was somehow working), I now receive the error message screen "To prevent possible data loss before loading the designer, the following errors must be resolved:"
"Could not find the type 'MyNamespace.MySpecialTextBox.' Please make sure that the assembly that contains the type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU."
I have tried the following:
- Open Configuration Editor and make sure the checkboxes under the "Build" columns are all checked and that there is no conflicting Platform configurations (the solution platforms are only x64/x86 and every sub-project is the same configuration)
- Doing as many Stack Overflow articles have suggested: Build -> Clean Solution, Build -> Rebuild Solution, exit Visual Studio, delete all bin and obj folders and then re-open Visual Studio. Error still shows up. My entire solution builds perfectly.
- Pretty much everything else on Google. This shows up with controls directly derived off of .NET Framework standard controls, or UserControl as well. It's like the Designer has become allergic to custom controls or something.
- I have verified that there are no broken references anywhere in my solution by going and expanding the references folders one by one and checking, fixing any yellow-triangle references (where Visual Studio is complaining about missing/broken references.
- This happens in both Visual Studio 2010 with all the updates applied as well as the very latest version of Visual Studio 2017 with all the updates applied.
</ul
Anyone have any idea what is going on?