混合“WPF 项目不支持窗口" [英] Blend "Window is not supported in a WPF Project"

查看:26
本文介绍了混合“WPF 项目不支持窗口"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Blend 报告Windows Presentation Foundation (WPF) 项目不支持 Window"感到沮丧.由于无法构建的配置,但无法完全弄清楚如何摆脱它.

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 quite work out how to mangle my way out of it.

我已经确定这可能是因为我尝试使用 x86 和 x64 配置的单一解决方案.无法告诉 Blend 2 哪个是活动的解决方案配置和活动的解决方案平台.

I've worked out it is probably due to my trying to have a single solution with x86 and x64 configurations. There is no way to tell Blend 2 which is the active Solution Configuration and active Solution Platform.

我认为这是配置系统中的一个弱点,或者可能是我设置的方式,但我有 Debug64 和 Debug 解决方案配置,其中每一个都与 平台 x86 和 x64.

I think it's a bit of a weakness in the configuration system, or maybe the way I've set things up, but I have Debug64 and Debug solution configurations one of each is used with the platform x86 and x64.

我也认为这是一个简单的排序问题 - x64 在 x86 之前,Debug 在 Debug64 之前,所以 Blend 最终会得到一个无法构建的 Debug with x64 配置.

I also think it's a simple sorting problem - x64 comes before x86 and Debug comes before Debug64 so Blend ends up with an unbuildable config of Debug with x64.

当我在 VS 中选择 Debug 和 x64 的组合时,它的 XAML 编辑器也无法加载.

When I choose the combination of Debug and x64 in VS, its XAML editor can't load either.

该解决方案是一个中等复杂的解决方案 - 有一个纯 Win32 DLL、C++/CLI 模型项目和主 WPF 项目使用的另外两个 WPF 程序集.

The solution is a moderately complex one - there's a pure Win32 DLL, C++/CLI Model project and two other WPF assemblies used by the main WPF project.

更新我已经从我的解决方案中删除了所有 x64 配置并重新构建了所有内容,但没有任何效果.

UPDATE I have ripped all the x64 config out of my solution and rebuilt everything with no effect.

然后我卸载了 Blend 2 并安装了 Blend 3 - 它也不喜欢.

I then uninstalled Blend 2 and installed Blend 3 - it doesn't like things either.

Visual Studio XAML 编辑器仍然很高兴,程序构建和运行也是如此.

The Visual Studio XAML editor is still very happy as is the program building and running.

(来自 oz 令人窒息的沮丧尖叫的回声)

(echoes of strangled scream of frustration from oz)

推荐答案

Blend 要求解决方案在配置管理器中还具有 AnyCPU 平台.
将不会加载解决方案中的任何 C++(包括 C++/CLI)项目.

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.

我的解决方案中有 AnyCPU +x86 +x64 平台,AnyCPU 不会构建非 C# 项目.

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

将窗口/控件放在 AnyCPU C# dll 中,以便它们可以在混合中进行编辑.
(不要从他们那里引用 x86/x64 项目.)

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

仅将 exe 设置为 x86 和 x64(无 AnyCPU) - 不会在混合中运行(无 AnyCPU),但解决方案仍将构建.

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

这篇关于混合“WPF 项目不支持窗口"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆