I have a WPF application that was developed using VS 2010 with C#. We would like to move to VS 2012 for various reasons. I am running Version 11.0.60610.01 Update 3 of VS 2012.
However, after opening the application solution with VS 2012, one of the windows will not display in the visual designer, reporting"Invalid Markup - Check the Error List for more information." Also, there is a "View code" link, which when clicked conveniently moves to the offending xaml code. At the top of the xaml file is the xmlns statement to the assembly containing the control I want instantiated in the xaml. Here are the relevant code snippets:
xmlns:MyCtrls="clr-namespace:MyControls;assembly=MyControls"
<MyCtrls:MyControl Name="Graph" MinWidth="300" MinHeight="120"/>
Hovering over the offending code (MyCtrls:MyControl), the tool tip displays: "The name "MyControl" does not exist in the namespace "clr-namespace:MyControls;assembly=MyControls"."
If I go to the Error List the following 2 errors are reported:
Error 1 The name "MyControl" does not exist in the namespace "clr-namespace:MyControls;assembly=MyControls".
Error 2 The type 'MyCtrls:MyControl' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
The MyControls DLL has been added to the project's References, the associated xaml.cs file which references this control compiles with no errors and provides the expected intellisense to the MyControl members, and the xmlns statement was filled in using intellisense in the xaml file, which would seem to indicate that the assembly has been added to the project correctly and is visible to the designer.
If I open this same solution using VS 2010, there are no problems reported when opening the xaml file.
Is this a known bug in VS 2012? Or is there some new syntax or keywords required that I am unaware of?
Thanks, Dave
Dave R&D SW Engineer Agilent Technologies