Reputation: 31
I'm working on a WPF solution. For some odd reasons, I'm getting the error "The type '...' was not found. Verify that you are not missing an assembly reference..." every time I add a usercontrol/custom control through XAML. I did build the solution, had the namespace declaration for XAML, made sure I had the correct assembly name, and made sure that the usercontrol itself doesn't contain any errors.
What's even weirder is that, when I ignore the errors and add the controls manually through the XAML editor (heck, even InteliSense in the XAML editor works), then build & run it, everything works (I'm guessing this means that there's no problem with the solution itself)
The controls show up in the toolbox, but I can't add it through the designer. As I stated, adding through the XAML editor/in code behind works, but it's really inconvenient. Adding through the XAML editor also raises the error, and stops the designer from loading, so it's even more annoying. Adding through code behind is just inelegant, and makes it hard for debugging.
EDIT: Opening the solution on a different computer doesn't solve the problem, so it's not a problem caused by Visual Studio. Also tested moving everything to a new project, still doesn't work, which means it's not a problem with the configurations, likely a problem with the code. If then, how come it builds & runs, and even IntelliSense works and the designer doesn't?
Upvotes: 1
Views: 850
Reputation: 31
Okay...nevermind, it's because I built it for x64, and apparently the designer just doesn't work with that since it's x86. Using "AnyCPU" seems to work.
Upvotes: 1