CSLA 4.0 Preview 2 / SL4 - ViewModel Related Bugs...

CSLA 4.0 Preview 2 / SL4 - ViewModel Related Bugs...

Old forum URL: forums.lhotka.net/forums/t/8542.aspx


SWITCH posted on Tuesday, February 16, 2010

I have been working on a proof of concept application using the current CSLA 4.0 Preview 2 release and Silverlight 4 and have uncovered a few problems that appear as though they could be bugs in the CSLA framework. So far, they have been mostly related to the ViewModel support:

  1. In \Csla\Csla.core\Reflection\MethodCaller.cs the privateMethodFlags constant has been changed to exclude the BindingFlags.NonPublic binding flag. This causes a problem in the MethodCaller class when FindMethod is called because it is not able to locate the private method named "QueryCompleted" and thus cannot return a MethodInfo object. Ultimately, this throws an ArgumentNullException: "Value cannot be null. Parameter name: method".

    Commenting out the compiler directive was the workaround I found for this issue.

    private const BindingFlags privateMethodFlags =
      BindingFlags.Public |
    //#if !SILVERLIGHT
      BindingFlags.NonPublic |
    //#endif
      BindingFlags.Instance |
      BindingFlags.FlattenHierarchy;

    I am not sure the reason this was done and if it is a bug, but maybe someone could shed some more light on this?
    .
  2. In the \CSLA\Source\Csla.Xaml\ViewModelBase.cs class the [Browsable(false)] attribute is specified on two properties(ManageObjectLifetime & Error) which is causing the following compile errors and which had to be commented out in order to get the Csla.Silverlight project to compile:
    • error CS0246: The type or namespace name 'Browsable' could not be found (are you missing a using directive or an assembly reference?)
    • error CS0246: The type or namespace name 'BrowsableAttribute' could not be found (are you missing a using directive or an assembly reference?)

This makes me wonder if the CSLA 4.0 Preview 2 Release is ready for use with SL4? Can anyone comment? Should I really be using the latest 3.8.2 drop of CSLA \ CSLA Light for my proof of concept app?

Thanks, Richard

RockfordLhotka replied on Tuesday, February 16, 2010

First, it is a preview release - it isn't ready for use at all really Big Smile

But I really do appreciate that you are trying to use it and that you are providing feedback - that is exactly the reason for doing the preview releases! I can't tell you how valuable feedback is at this stage!

------

Issue 1 was reported earlier and has been fixed in svn.

The MethodCaller code that creates the delegates to invoke methods without reflection was entirely reworked - which is a really big thing - so it isn't surprising that there's a bug or two. Additionally, in SL reflection was used up to now - so this is the point at which SL gets rid of that use of reflection in favor of a faster approach - but again, a big change.

I'm rather surprised that this is the only bug we've found thus far actually.

Issue 2 was also reported earlier and has been fixed in svn.

To help prevent this, I subsequently spent the time to put together a build server. That wasn't easy, as none of the open-source build server technologies support .NET 4 yet, so I had to cobble together something that could be executed by TeamCity via command line. That's working, but isn't ideal. However, it at least ensures that any code checked in is built against both .NET and SL.

----

Of course things are more complex now, because the VS10 RC is out, but SL4 doesn't work with it. So I have two machines running the RC, but must do most dev work on Beta 2 Tongue Tied

I just today created an RC branch so at least some of the basic RC work can be done (in the Csla.Xaml and Csla.Web/Csla.Web.Mvc projects anyway). But it is an ugly situation that makes SL4 work rather challenging.

RockfordLhotka replied on Tuesday, February 16, 2010

I should also say...

If you are actually doing a meaningful POC then use 3.8.2.

You should only use 4 if you are interested in helping provide feedback.

The next preview (hopefully this week) of 4 will include some semi-working business/validation rule subsystem changes. I expect that will break nearly everything, so hold onto your shorts for that one!

SWITCH replied on Wednesday, February 17, 2010

Hi Rocky,

Thanks for the detailed feedback! It's much appreciated. That's great you had already caught and fixed them... guess I need to get better at searching the buglog first before posting. You guys always move so quick it's hard to keep up sometimes! ;)

I wasn't sure how far along the preview version was but I thought I would give it a shot since we are just starting out on the POC. We are hitting the same issues with VS 2010 RC and SL4, which is making our lives tough too (we decided to stick with VS2010 Beta 2 and SL4 Beta 2). If time constraints allow, we'll stick with CLSA 4.0 and keep the feedback coming, but we may fall back to 3.8.2 if time is short.

Cheers, Richard

Copyright (c) Marimer LLC