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

查看:37
本文介绍了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 和封闭的选择标签都有一个错误,并且不会加载设计窗口/预览(在 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天全站免登陆