Is there any way (XAML) to refer to an assembly with spaces in its name?

Is it impossible to refer to an assembly with spaces in its name? Do I need to rename my assemblies so that they do not contain spaces? There is no way to avoid spaces? I cannot find so many examples of people who have this problem, not to mention any solutions ...

XAML example:

<UserControl x:Class="SomeClass" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Some.Namespace;assembly=Some Assembly With Spaces In The Name" > 

And this is the error that the compiler gives when trying to do this:

Unknown build error, '' clr-namespace: Some.Namespace; assembly = some assembly with spaces in the name 'display URI is not valid. Line 4 Position 2. '

Putting 'or' around the assembly name does not help.

+6
xaml
source share
2 answers

It looks like the error you are talking about that is "fixed" ...

I had a similar problem with ValueConverter in a separate assembly, and the way to build it was to include the default constructor in my ValueConverter class. Without this, VS will not build it if it is contained in the assembly with spaces in the name.

Unfortunately, it builds, but then crashes with a XamlParseException when I fire it.

If I do the same, referring to the assembly without spaces, everything is in order.

As an aside, you define the xmlns:local namespace, but refer to another assembly - if your namespace is really local, you can simply do:

 <xmlns:local="clr-namespace:Some.Namespace"/> 
+1
source share

This solution seems to have fixed the issue for me with spaces in the assembly name.

+3
source share

All Articles