|
I was getting a strange Silverlight compile error in my Page.xaml the other day (while migrating stuff from 1.1 Alpha to 2.0 Beta):
Length cannot be less than zero.
Parameter name: length
At first it sounds like I was setting a wrong value - like trying to reference the "-1" position on a string. But, it actually was a constraint in what namespaces Xaml allows.
In 1.1 Alpha, this would be ok:
xmlns:Tank.Core="clr-namespace:Tank.Core;assembly=Tank.Core"
Which you could then reference like so:
<Tank.Core:Dashboard x:Name="MyDashboard" />
However, that line kept throwing the error when I tried to compile.
It seems like if I remove the period ".", then it works again, like so:
xmlns:Tank1="clr-namespace:Tank.Core;assembly=Tank.Core"
<Tank1:Dashboard x:Name="MyDashboard" />
Strange. I'm not fully sure why, maybe some parsing thing with periods "." in beta, but it was good to have a work-around.
I got the same error. When adding a namespace with a period in it. This
would have taken me forever to debug. Thanks for posting.
I had the same error when erronously declaring namespace references with
dots '.' in XAML.
xmlns:Abc.De="clr-namespace:AbraCadabra.Deutch"
xmlns:AbcDe="clr-namespace:AbraCadabra.Deutch"