Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble when trying to open WPF project in Expression-Blend 4, which was created in Visual Studio 2010

I'm create my WPF project in VS 2010. After I finished my work with functional GUI, I wanted to edit template of my controls in Blend 4. But when I open project in Blend, in DesignMode, he tell me


Invalid XAML


In Result window he wrote:


[ControlName] is not supported in a Windows Presentation Foundation (WPF) project


Where [ControlName] is list of default controls, which I have used in my project (such as Window, DockPanel, etc.)

What to do to avoid this issues and be able to edit WPF forms at DesignMode of Expression-Blend4?

EDIT:

Possible workaround.

After some comparasion of empty projects (*.csproj file), which was created by Blend and by Studio, I have find out that VisualStudio create it with next line:

<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
 ...

while Blend uses the following lines:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

So, if you change x86 to AnyCPU, Blend will open project as expected.

like image 914
stukselbax Avatar asked Jul 21 '11 12:07

stukselbax


1 Answers

I have only seen this error message once before. After comparing a new solution file with the one that wouldn't load I discovered that Blend requires the AnyCPU platform/configuration to be defined.

If that does not work, ensure that you have all the required assemblies referenced for a WPF project: PresentationCore, PresentationFramework, and WindowsBase.

HTH,

like image 113
Dennis Avatar answered Sep 21 '22 02:09

Dennis