AlternateContent标记导致IDE出现问题,但不会导致编译器出现问题 [英] AlternateContent Tags causing issues with IDE, but not compiler

查看:566
本文介绍了AlternateContent标记导致IDE出现问题,但不会导致编译器出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究传统产品。我需要根据构建常量使复杂UI的区域可选。将这些区域移动到控件中是不可行的,因此我使用AlternateContent标签(mc:AlternateContent)。

I am working on a legacy product. I need to make regions of a complex UI optional, based on build constants. It is not feasible to move these regions into controls, so I am using AlternateContent Tags (mc:AlternateContent).

这在编译时非常有效,应用程序按预期运行。

This works perfectly, at compilation and the application runs as expected.

但是,IDE为每个AlternateContent声明了一个错误,并附上了Choice标签,并且不会加载设计窗口/预览(在VS或Blend中):

However, the IDE claims one error for each AlternateContent, and enclosed Choice Tag, and will not load the Design window/preview (in VS or Blend):

The name "AlternateContent" does not exist in the namespace "http://schemas.openxmlformats.org/markup-compatibility/2006"
The name "Choice" does not exist in the namespace "http://schemas.openxmlformats.org/markup-compatibility/2006"

我尝试过,重建,清理和重建,在发布,调试,x86,x64和重新启动之间更改构建设置。什么都没有帮助。它甚至在Blend中给出相同的错误。

I have tried, rebuilding, cleaning and rebuilding, changing build settings between release, debug, x86, x64, and rebooting. Nothing helps. It even give the same errors in Blend.

我希望这只是我正在做的事情,我可以解决它;或者可能是我应该使用的更新的名称空间URI。如果我无法解决错误,我希望有人知道在IDE中抑制这些错误的技巧,所以可以使用它。

I am hoping that this is just something stupid that I am doing, and I can fix it; or possibly a newer Namespace URI I should be using. If I cannot resolve the errors, I am hoping someone knows a trick to suppress these errors in the IDE, so can use it.

我有一个完全更新的VS2013 Premium安装。然而,它在运行VS14 CTP的测试机器上有一个小故障,另一个运行VS2012(完全更新),两者都没有任何插件;所以我不得不假设我的电脑安装不是问题。

I have a fully updated VS2013 Premium installation. However, It has the glitch on a test machine running VS14 CTP, and another running VS2012 (fully updated), both without any add-ins; so I have to assume it is not a problem with my PCs install.

推荐答案

派对有点晚了但是如果你将mc标记添加到Ignorable属性,错误就会消失。当我编译项目的不同风格时,您的内容不会显示在设计器中,但对我有用。

A little late to the party, but if you add the mc tag to your Ignorable attribute the error goes away. Your content won't show in the designer but worked for me when I compiled the different flavours of my project.

<UserControl...
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:conditional="defined-in-assembly.cs"
    mc:Ignorable="d mc"/>

这篇关于AlternateContent标记导致IDE出现问题,但不会导致编译器出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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