Back to Main Load Limitations Page

References to classes (x:Class excluded) defined within the project are not supported.


For example the cider namespace causes an error:


		 <Window 
		   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		   x:Class="CiderWindowsApplication2.InProjectTypeReference"
		   xmlns:cider="clr-namespace:SliderAdornerLib"
		   Title="In Project Type Reference Examples">
		   [<StackPanel>]
		     [<cider:SliderAdornedButton] Content="SliderAdornedButton"/>
		   [</StackPanel>]
		 </Window>
	

References to classes defined in other assemblies are supported.

* can build a control or class in a separate assembly (DLL)
*Add a reference to that assembly using "Add Reference..."->Browse
*Project references are not supported
* can then add a mapping statement for that control to the XAML file and use it:

In this updated example, the cider namespace will not cause an error

		 <Window 
		   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		   xmlns:cider="clr-namespace:SliderAdornerLib;assembly=SliderAdornerLib"
		   x:Class="SliderAdorner.Window1"
		   Title="Main Window" Width="500" Height="350">
		   [<StackPanel>]
		     [<cider:SliderAdornedButton/>]
		   [</StackPanel>]
		 </Window>
	

Note: There are limitations on the scope of this support:

* When a XAML file that references an external assembly is loaded, that assembly becomes locked on disk and cannot be rebuilt or replaced until Visual Studio is closed and restarted.
Microsoft Communities