Visual Studio设计的64不起作用不起作用、Visual、Studio

2023-09-08 10:17:47 作者:帅飞一条街

在Visual Studio 2010中64位我不能设计我的形式。 我不断收到这样的警告(和错误):

In Visual Studio 2010 64bit I can't design my forms. I keep getting this warning (and error):

Warning 18  
The designer could not be shown for this file because none of the classes within it can be designed.  The designer inspected the following classes in the file: 
MainForm --- The base class 'Blah' could not be loaded.  Ensure the assembly has been referenced and that all projects have been built.

这只是发生在我编译64 ... 86中的设计可以很好地处理。

This only happens with when I compile for x64 ... in x86 the designer works well.

只是要明确的是,我需要的项目上工作的x64,因为很多项目的组件都被编译在x64和如果表格中的x86将无法正常工作。

Just want to be clear that I NEED the project to work on x64 because a lot of the project's components are compiled in x64 and won't work if the forms are in x86.

有没有其他人遇到了这一点,并找到了解决方法?

Has anyone else encountered this and found a solution ?

推荐答案

我可以通过创建与用户控件WPF应用程序(提上了WPF应用程序的用户控件,并建立64)瑞普你的问题。

I can repro your problem by creating a WPF application with a user control (put the user control on the wpf app, and build x64).

下面是我的猜测,这是怎么回事: Visual Studio是一个32位的应用程序时,WPF设计已加载引用的程序集(你看到的行为所有的时间,当您使用用户控件,在那里你必须重建,以获得设计更新)。 Windows不支持咚的32位和64位 - 你都必须是一个32位应用程序或64位应用程序,期限,不共享

Here's my guess as to what's going on: Visual Studio is a 32-bit application, the the WPF designer has to load referenced assemblies (you see that behavior all of the time when you use user controls, where you have to rebuild to get the designer to update). Windows does not support a "thunk" between 32-bit and 64-bit -- you have to be either a 32 bit app or a 64-bit app, period, no sharing.

由于兴田WPF设计是32位的,大会需要是32位的。

Since hte WPF designer is 32-bit, the assemblies need to be 32 bit.

下面是一个可能的解决方案: 与任何CPU选项设计您的应用程序。这将导致您的code到JIT在32位平台上的32位和64位平台64位。

Here is a possible solution: Design your app with the "Any CPU" option. This will cause your code to JIT to 32-bit on 32-bit platforms and 64-bit on 64-bit platforms.

设计师将工作在任何CPU,因为程序集,即时编译到32位。 当你需要调试64位具体地说,切换您的构建配置为64位(知道你必须切换回32位或任何CPU做表单设计)