Blend “Window is not supported in a WPF Project”

依然范特西╮ 提交于 2019-12-03 23:26:19

Blend requires the solution to ALSO have an AnyCPU platform in the configuration manager.
Any C++ (including C++/CLI) projects in the solution will not be loaded.

I have AnyCPU +x86 +x64 platforms in my solutions, the AnyCPU doesn't build non C# projects.

Put the windows/controls in AnyCPU C# dlls, so they can be edited in blend.
(Do not reference x86/x64 projects from them.)

Set the exe as x86 and x64 only (no AnyCPU) - will not run in blend (no AnyCPU), but the solution will still build.

There are also a few other reasons this could happen:

1) Missing references. Add a reference to PresentationCore, PresentationFramework, and WindowsBase

It could also be looking for .dlls from the wrong platform. I just solved my problem by making the following change:

In the .csproj file in question, change this line

<Platform Condition=" '$(Platform)' == '' ">x86</Platform>

To

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

I came across this issue with VS2010 and Blend4. Suddenly my project would not render in Blend.

The issue was that a developer on our team setup Custom Build Configurations. When he did this he removed Debug. Once i added Debug back to the build configuration Blend was happy again.

On my side, I solved the problem this way:

  • the AnyCPU trick (but not enough...)
  • Unload project, edit project file, look at 4.0 framework references and change them to 4.5 (target and minial required version).

rebuild solution, then Blend Preview for WPF 4.5 stopped to show the error messsage (window is not supported...).

Thanks all for putting me on the track !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!