My application crashes with "DataPortal.Create failed (Invalid URI: The hostname could not be parsed.)" error.
After little debugging I've found the source of the exception. Exception occurs in "public RuleUri(string typeName, string propertyName)" constructor. My typeName has non-latin name. It has cyrillic name. And encoded "uriString" looks like this:
"rule://CslaTest.Documents.-D0-94-D0-BE-D0-BA-D1-83-D0-BC-D0
Uri is failed if char like '-' goes right after '.' (dot). If I will change above to this:
"rule://CslaTest.Documents.D0-94-D0-BE-D0-BA-D1-83-D0-BC-D0
everythings is fine!
Why no one react on this bug? Do you need a sample of namespace?
Hi,
Well, the question is, is it a bug in .NET or in CSLA?
And are there other parts affected as well?
For now - I have registered the issue in repository:
https://github.com/MarimerLLC/csla/issues/182
Well, I don't think that's a bug in Uri class. Uri has some format and that format don't like when char like '-' goes right after '.'.
For know I fix it like this:
instead:
var uriString = "rule://" + hostName + "/" + EncodeString(propertyName);
use this:
var uriString = "rule://" + hostName.Replace(".-", ".") + "/" + EncodeString(propertyName).Replace(".-", ".");
But I would like, CSLA could handle this situation by itself.
P.S.
My class:
namespace CslaTest.Documents
{
public abstract class Документ : BusinessBase<Документ>
I'm quite sure this also applies to query parameters to the URI like additional fields or maybe even values added to the RuleName.
But I am suspection there may be other areas affected as well.
I'm new to CSLA. So, I don't fully understand what are you talking about. For now, my test project goes fine.
If you need some cyrillic words for reproducing problem you can use this site for example:
http://learningrussian.net/vocabulary/russian-words/russian-months-and-seasons.php
Copyright (c) Marimer LLC