Too complex and why a separate class library for validations

Nov 19, 2009 at 3:07 PM

Hi this project is promising but the way it's packaged for download is too complex. Having the validation rules

as a separate class library is too complicated. I was trying to merge everything into one project and then the

GetType stuff wasn't working because the rules have to be compiles into their own object/library. Way too

complex... there should be a simple rules file in xml that can be edited on the fly without compilation

of a separate LIB.

Nov 20, 2009 at 10:58 AM
Edited Nov 20, 2009 at 11:05 AM

I'm afraid you'll find that most applications are built from multiple projects. Modularity has its advantages.

You only need to reference two libraries to use xVal for WebForms, xVal.WebForms.dll and xVal.dll. The rules are created by adding DataAnnotations attributes to your model properties. So if your looking for xml based rules, this might not be the project for you.

Hope this helps.

Nov 20, 2009 at 1:48 PM

In addition to the libraries that you mentioned I was also having to add a reference to xVal.WebForms.Demo.

The contents of Demo had to be compiled separately as a class library in order to have the GetType ability.

This was the issue that caused my frustration. If I had been able to take the contents of Demo and move them

into my project, I would have been satisfied. But when I tried that, there were runtime errors related to the GetType

invocation. I did think the overall project was cool and useful but the obstacles I had with trying to use it practically

made it seem unappealing at the time I tried it.


Nov 20, 2009 at 6:40 PM

What are trying to do? Run the demo web site? You should be able to simply open xVal.WebForms.Demo.WebSite.sln in Visual Studio and hit F5.

If you're trying to do something else, I'll need some more information as to what you are trying to accomplish and the exceptions you are getting.

I'm glad that you had an initial interest in the project. Its still very young and I know there is room for improvement. If you have any ideas to make it better (or bug reports), please let me know!

Nov 20, 2009 at 7:45 PM
jrummell wrote:

What are trying to do? Run the demo web site? You should be able to simply open xVal.WebForms.Demo.WebSite.sln in Visual Studio and hit F5.

Yes, that would be a nice start. But in actuality the project does not work in the manner you describe. Doing so will produce the following error:


Error    1    The type or namespace name 'Demo' does not exist in the namespace 'xVal.WebForms' (are you missing an assembly reference?)    C:\xVal.WebForms 0.1A\xVal.WebForms 0.1\xVal.WebForms.Demo.WebSite\Default.aspx.cs    5    21    C:\...\xVal.WebForms.Demo.WebSite\


So in order to remedy this situation, the separate Demo project must be compiled and then the output DLL copied to the Demo.Website project and a reference added. This was the crux of my complaint- the separate DLL containing the validation rules.

Nov 21, 2009 at 3:58 PM

I understand now, sorry about that! I fixed the release so that the demo website includes the bin folder and all required references. I'm not sure how I missed that.

Since 0.1 was released I reorganized the solution so that its much easier to use the demo. All you need to do is checkout the latest from the trunk, open xVal.WebForms.Demo.sln, compile and then view in browser.