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
This is a bug both in VS2008 and VS2010.
Here's the bug report:
http://connect.microsoft.com/VisualStudio/feedback/details/646328/the-designer-could-not-be-shown-with-platform-x64
It seems there is no fix for this yet.
The proposed solution from Microsoft is to move the base classes to a separate assembly, compiled using AnyCPU or x86 (if your actual project must be x64).
Unfortunately this applies to all base classes: if your inheritance is FormC
: FormB
: FormA
, then both FormA
and FormB
must be in an (external) 32bit assembly, if you want to edit FormC
in the designer.
Of course, this also applies to UserControls! I wish I had known this before our team decided to move to 64bit - a notice when changing the compile options would have been really nice, Microsoft...
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).
Here's my guess as to what's going on:
Visual Studio is a 32-bit application and 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 sharing between 32-bit and 64-bit - you have to have either a 32 bit app or a 64-bit app, period, no sharing.
Since the WPF designer is 32-bit, the assemblies need to be 32 bit.
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.
This couple of links from microsoft explain exactly this problem: I resume them: it is a limitation for VisualStudio since it does not have an x64 version.
http://connect.microsoft.com/VisualStudio/feedback/details/583872/windows-forms-designer-cant-design-form-inherited-from-form-in-x64-assembly
http://support.microsoft.com/kb/967050