I just installed Visual Studio 2010 and converted one of my Visual Studio 2008 WPF projects over for testing. While the project builds and runs correctly, the VS Designer cannot handle the custom namespace mappings I have giving the error:
Assembly must be specified for XAML files that are not part of a project. Reopen this XAML file after adding it to a project, close this file and reopen it using the project it is associated with, or modify the clr-namespace to include the name of the assembly.
The namespaces in question are part of the project. Visual Studio 2008 had no problems with the XAML. So I created a new blank WPF project called Test1
with the namespace being Test1
. I then edited the generated MainWindow.xaml to add a single mapping for local
:
<Window x:Class="Test1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Test1"
Title="MainWindow" Height="350" Width="525">
<Grid />
</Window>
This gives the same error. And, amazingly, Google reports no results for the error! I tried a few variations such as appending ;assembly=
or ;assembly=Test1
, but that did not help.
Can anyone spot what I'm doing wrong? If nothing, I'd greatly appreciate suggestions for why this may be failing.
Edit: As per the comments, it turns out that this only occurs when the project is opened from a networked share. It does not occur if the project is opened on a local drive. I would like, however, to be able to open it on the network share so I'm going to leave the question open.
clr-namespace: The CLR namespace declared within the assembly that contains the public types to expose as elements. assembly= The assembly that contains some or all of the referenced CLR namespace. This value is typically just the name of the assembly, not the path, and does not include the extension (such as .
The mc:Ignorable namespace provides xaml definitions that are "ignored" by the xaml processor. This allows you to specify information used by the designer at design time which is ignored at runtime.
XAML namespaces use the standard XMLNS attribute to define the namespace. They use unique names via URIs. They also can use namespace prefixes which provide a means to reference multiple namespaces from the same markup source.
To resolve the error “The tag does not exist in XML namespace” in WPF application, need to ensure whether the Target framework of an application and Target framework of a referred Syncfusion assemblies are of same version.
Neil Allen is right. Map the folder as drive and all will be fine. How to map: http://www.online-tech-tips.com/computer-tips/how-to-map-a-drive-in-windows/
I’ve had the same problem but I found using a mapped drive letter instead of the UNC path works for me.
Regards
Neil Allen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With