找不到类型“ xxx.xxx.xxx”。请确保组装 [英] Could not find type 'xxx.xxx.xxx'. Please make sure that the assembly

查看:110
本文介绍了找不到类型“ xxx.xxx.xxx”。请确保组装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了StackOverflow,并尝试打开引用另一个项目中的UserControl的表单时发现了类似的问题。

I've searched StackOverflow and found similar problems when I try and open a form that references a UserControl in a different project.

我得到了


为防止在加载设计器之前可能丢失数据,必须解决以下错误:

To prevent possible data loss before loading the designer, the following errors must be resolved:

与以下两个错误有关的消息:

message relating to the following two errors:


找不到类型'MyNamespace.CommonUi.InformationBox'。请确保
确保引用了包含该类型的程序集。如果此
类型是开发项目的一部分,请确保已使用当前平台
或任何CPU的设置成功构建了项目

Could not find type 'MyNamespace.CommonUi.InformationBox'. Please make sure that the assembly that contains this 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.

AND


变量'InformationBox1'是未声明的或从未声明过的

InformationBox1 是用户控件的实例 InformationBox 在设计器中的表单上-只是被引​​用为;

InformationBox1 is an instance of the user control InformationBox that is on the form in the designer - it's just referenced as;

Friend WithEvents InformationBox1 As MyNamespace.CommonUi.InformationBox

MyNamespace.CommonUi 项目构建成功。

我在项目中获得了智能感知,因此我有理由相信它会被正确引用。

I get intellisense in the project so I'm reasonably confident that it's being referenced correctly.

到目前为止,与其他人一样:

So far, the same as other people have had:

这是一个从VS2005中的.NET2 / x86迁移到的项目。在VS2012中为NET4 / x64。

This is a project that's been migrated from .NET2/x86 in VS2005 to .NET4/x64 in VS2012.

现在,当该解决方案在64位以下运行时,它将无法正常工作,并且出现此设计器错误。但是,如果我将其切换为32位(从技术上讲完全是AnyCPU),则可以打开设计器。

Now when the solution is running under 64 bit it doesn't work and I get this designer error. However, if I switch it to 32 bit (well technically AnyCPU) I can open the designer just fine.

我已经阅读了类似线程中的其他建议,但它们看不出提供任何解决方案(我什至走到了将其移至右侧并使其重建选项)

I've read through the other suggestions in similar threads but they don't see to provide any solution (I've even gone as far as the "move it left & right to get it to rebuild" option)

推荐答案

我认为问题在于Visual Studio的本机为32位,并且无法对其进行GUI编辑一些64位组件(例如ListView)。
例如在具有ListView的表单上,需要将解决方案更改为32位以编辑GUI。

I believe the issue is that Visual Studio is natively 32bit and one cannot do GUI editing for some components (E.g. ListView) in 64bit. E.g. on forms where you have ListView, you need to change the solution to 32bit to edit the GUI.

因此,总的来说,当您遇到此问题时,答案是:

So the answer in short is, when you're facing this issue:


  1. 将解决方案更改为32位或AnyCPU

  2. 清理并重建解决方案/项目

  3. 打开GUI进行编辑

  4. 保存,将解决方案更改回64位

  5. 清理并重建

  6. 以64位运行

  1. Change the solution to 32bit or AnyCPU
  2. Clean and rebuild the solution/project
  3. Open the GUI for editing
  4. Save, change the solution back to 64bit
  5. Clean and rebuild
  6. Run in 64bit

不幸的是,Visual Studio 尚不支持64位,因此所有控件都必须设计为32位模式(或AnyCPU模式)。

Unfortunately Visual Studio doesn't come in 64bit as yet, hence all controls need to be designed in 32bit mode (or AnyCPU mode).

有关更多详细信息,请参见此问题。

See this question for more details.

VS 2010设计器错误在Windows7中找不到XYZ类型。在XP中可以正常运行

这篇关于找不到类型“ xxx.xxx.xxx”。请确保组装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆