Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 11 - Design view is unavailable for x64 and ARM target platforms because the document contains custom elements

I'm test-driving Visual Studio 11 beta and it appears I've hit a major snag.

Has anyone tried opening an actual production WPF project that contains WPF windows with User Controls? When I try to open a WPF Window or control that contains user controls, the design view displays a nice error message:

"Design view is unavailable for x64 and ARM target platforms because the document contains custom elements."

It appears to be a major wtf... since most developer machines these days are x64.

* UPDATE: *

Reproduced this in a new VS 2011 WPF project:

  1. Add a xaml resourec file with styles (in the same project as the user control)
  2. Reference this file in a user control using the tag

Immediately, the "Design view is unavailable for x64 and ARM target platforms..." pops up.

As soon as I remove the resource reference, the designer starts working again.

like image 891
Ziga Avatar asked Mar 01 '12 20:03

Ziga


2 Answers

The "x64 or ARM" in the message refers to the current target configuration of the project, not to the machine on which Visual Studio is running. That is, if you change the target platform configuration of the project to x86 or Any CPU, you should not get this message.

You can change the target platform from the Standard Toolbar (select the "Add or Remove Buttons" item at the end of the toolbar, and select "Solution Platforms").

If your solution platform is x86 or Any CPU, please add a comment to this post and let me know. I'd be interested in investigating.

like image 120
James McNellis Avatar answered Oct 25 '22 13:10

James McNellis


I resolved this by doing the following in Visual Studio:

  1. Select the solution node within Solution Explorer.
  2. Within the Properties pane, set "Active config" to an x86 processor type.
  3. Display Properties for application project.
  4. Select the Build tab on the navigation pane.
  5. Ensure "Platform target" is set to x86.

After completing these steps:

  1. Restart Expression Blend.
  2. Observe the designer is now loaded with UI
like image 38
Scott Nimrod Avatar answered Oct 25 '22 12:10

Scott Nimrod