Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

c# - Failed to load toolbox item. It will be removed from the toolbox , what is a ways to solve it?

An issue I faced is - I have the custom UserControl which I would like to add to my TabControl as an additional tab, so to make it I just found my UserControl in the toolbox and pulled it to my TabControl and immediately I get an error popup which says

Failed to load toolbox item. It will be removed from the toolbox

After research, I found a few answers like these

https://stackoverflow.com/a/44628024/5709159

and this one

https://social.msdn.microsoft.com/Forums/vstudio/en-US/77e10b58-43cc-4aab-919f-888f14f99571/x64-class-library-of-user-controls?forum=csharpgeneral

They are talking about the mismatch between 32 and 64-bit processing, but I really can't get the idea about how to fix it? Like where I need to click or what I need to recompile to make it work? If someone could translate me what is written at those links to the more clear language I'll appreciate it.

EDIT

I am trying to add a completely new UserControl, which means I create a new UserControl, and as is I open the toolbox and pull it in my tab that was created in tab control as a result I get an error above. So, there are no constructors or early access to parent issues.

Regarding CPU I don't use AnyCPU I use x64 could it be an issue? And also in order to check, I can't switch to AnyCPU because my project is not compatible with AnyCPU.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In your project properties, try changing the Platform target in the build tab to x86. It worked for me when I had a similar problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...