Blend “Window is not supported in a WPF Project”

前端 未结 4 2054
无人共我
无人共我 2021-02-19 01:59

I am having a frustrating time with Blend reporting \"Window is not supported in a Windows Presentation Foundation (WPF) project.\" due to unbuildable configurations but can\'t

相关标签:
4条回答
  • 2021-02-19 02:30

    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.

    0 讨论(0)
  • 2021-02-19 02:45

    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.

    0 讨论(0)
  • 2021-02-19 02:46

    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>
    
    0 讨论(0)
  • 2021-02-19 02:49

    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 !

    0 讨论(0)
提交回复
热议问题