VS 2010的设计师错误“找不到类型XYZ”在Windows7。在XP中工作正常找不到、设计师、正常、错误

2023-09-03 00:22:18 作者:年少轻狂亦多情

我被困在VS 2010的C#.NET中的一个问题。我已经在Windows XP中的项目,包括窗体,类和一些我自己的自定义组件。这些组件是内置的MS组件的简单扩展(如DataGridViewEx为DataGridView中的扩展)。一切都在XP中运行良好。我试图端口这个项目交给VS 2010的Windows 7/64位。我已经得到了解决编制确定在Windows 7,但在设计模式,当我打开包含自定义的控件中的一个形式,我得到一个错误找不到类型XYZ.DataGridViewEx。请确保包含此类型的程序集被引用。 XYZ是我使用这些控件的命名空间,这是相同的命名空间正在使用的控件的形式。所有都是相同的VS项目的一部分。

I'm stuck on a problem in VS 2010 C# .NET. I've had a project on Windows XP that includes forms, classes and a handful of my own custom components. These components are simple extensions of built-in MS components (e.g. DataGridViewEx as an extension of DataGridView). Everything has worked fine in XP. I'm trying to port this project over to VS 2010 on Windows 7 / x64. I've got the solution to compile OK on Windows 7, however in design mode, when I open a form that contains one of the custom controls, I get an error 'Could not find type XYZ.DataGridViewEx. Please make sure that the assembly that contains this type is referenced.' XYZ is the namespace I use for these controls and it is the same namespace as the forms that are using the controls. All are part of the same VS project.

当我在同一个项目中不包含这些自定义的控件中的一个,打开一个表单,表单打开在设计好了,我看到了自定义控件沿着左侧在工具箱中。但是,如果我再尝试拖动这些控件之一成这种形式,它会弹出无法加载工具箱项DataGridViewEx的错误消息框。它将从工具箱中删除。然后它就会从工具箱中取出。

When I open a form in the same project that does not contain one of these custom controls, that form opens OK in the designer, and I see the custom controls along the left side in the toolbox. However if I then try to drag one of these controls into that form, it pops up an error message box 'Failed to load toolbox item 'DataGridViewEx'. It will be removed from the toolbox.' And then it gets removed from the toolbox.

一切总是工作正常在XP与解决方案。此问题只发生在VS解决方案在Windows 7/64位。

Everything was always working fine in VS solution in XP. This problem only occurs in the VS solution in Windows 7 / x64.

我不明白为什么它抱怨不能够找到该组件,因为该组件是同一项目的一部分。这是一个有效的事情,不是吗?

I don't understand why it complains about not being able to find the component, since the component is part of the same project. That's a valid thing to do, isn't it?

我已经在网上搜索/论坛,发现找不到类型错误的情况下,但它似乎是由一个不同的问题引起的,而我还没有找到一种方法来摆脱错误

I've search the web/forums and found cases of the 'Could not find type' error, but it seemed to be caused by a different issue, and I haven't yet found a way to get rid of the error.

任何帮助/提示是多少AP preciated!

Any help/tips are much appreciated!

推荐答案

如果你的项目是针对64位,你需要建立的32位和选择的32位解决方案,同时做你的图形用户界面的编辑。这是因为工作室是32位,因此无法加载64位的控制。

If your project is targeted at 64 bit, you need to build for 32 bit and choose the 32-bit solution while doing your GUI editing. This is because studio is 32-bit so cannot load 64-bit controls.

 
精彩推荐
图片推荐