在 Visual Studio 2010 中创建的 Expression-Blend 4 中尝试打开 WPF 项目时出现问题 [英] Trouble when trying to open WPF project in Expression-Blend 4, which was created in Visual Studio 2010

查看:75
本文介绍了在 Visual Studio 2010 中创建的 Expression-Blend 4 中尝试打开 WPF 项目时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 VS 2010 中创建我的 WPF 项目.在我完成我的功能 GUI 工作后,我想在 Blend 4 中编辑我的控件模板.但是当我在 Blend 中打开项目时,在 DesignMode,他告诉我

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

无效的 XAML

在结果窗口中他写道:

[ControlName] 在 Windows Presentation Foundation (WPF) 项目中不受支持

其中 [ControlName] 是我在项目中使用的默认控件列表(例如 Window、DockPanel 等)

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

如何避免此问题并能够在 Expression-Blend4 的 DesignMode 中编辑 WPF 表单?

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

可能的解决方法.

对由 BlendStudio 创建的空项目(*.csproj 文件)进行一些比较后,我发现 VisualStudio用下一行创建它:

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>
 ...

而 Blend 使用以下几行:

while Blend uses the following lines:

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

因此,如果您将 x86 更改为 AnyCPU,Blend 将按预期打开项目.

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

推荐答案

我之前只看到过一次此错误消息.在将新的解决方案文件与无法加载的解决方案文件进行比较后,我发现 Blend 需要AnyCPU 平台/配置来定义.

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.

如果这不起作用,请确保您拥有 WPF 项目引用的所有必需程序集:PresentationCorePresentationFrameworkWindowsBase.

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

HTH,

这篇关于在 Visual Studio 2010 中创建的 Expression-Blend 4 中尝试打开 WPF 项目时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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