Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AlternateContent Tags causing issues with IDE, but not compiler

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.

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"

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.

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.

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.

like image 826
John Christman Avatar asked Jun 27 '14 19:06

John Christman


1 Answers

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"/>
like image 149
Redroy Avatar answered Nov 16 '22 02:11

Redroy