Silverlight 4

Jun 11, 2010 at 9:12 PM
Thomas, Do you have any plans of a Silverlight 4 build? Thanks Vinay
Jun 14, 2010 at 3:53 PM

I tried to build the silverlight components of the framework in silverlight 4. I built the following libraries. ConcurrentHashtable_Silverlight.dll, ObticsBindingHelper_Silverlight.dll and Obtics_Silverlight.dll. I get the following exception on expressionobserver.execute. May be you would recognize it.

System.TypeInitializationException was caught
  Message=The type initializer for 'Obtics.Values.Transformations.PipelineResultTransformation`3' threw an exception.
  TypeName=Obtics.Values.Transformations.PipelineResultTransformation`3
  StackTrace:
       at Obtics.Values.Transformations.PipelineResultTransformation`3.ConstructPRT(Int32 hash, TKey key)
       at Obtics.Carrousel.InternalCarrousel`2.Get(TKey key, Func`3 creator)
       at Obtics.Carrousel.Get[TOut,TKey](TKey key, Func`3 creator)
       at Obtics.Values.Transformations.PipelineResultTransformation`3.Create(TKey key)
       at Obtics.Values.RewriterHelper.Cacher1[TArg1,TType](Func`2 generator, TArg1 arg1)
       at lambda_method(Closure , SmartCollection`1 )
       at Obtics.Values.ExpressionObserverObject.Execute[TPrm1,TResult](TPrm1 prm1, Expression`1 original)
       at Obtics.Values.ExpressionObserver.Execute[TPrm1,TResult](TPrm1 prm1, Expression`1 original)
       at SLSocketsApp1.MainPage.get_TotalRowCount()
  InnerException: System.MethodAccessException
       Message=Attempt by method 'Obtics.Values.Transformations.PipelineResultTransformation`3<Obtics.Tuple`2<System.__Canon,System.__Canon>,System.Int32,System.__Canon>..cctor()' to access method 'Obtics.Values.RewriterHelper+Generator`2<System.__Canon,System.Int32>..ctor()' failed.
       StackTrace:
            at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
            at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
            at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
            at System.Activator.CreateInstance[T]()
            at Obtics.Values.Transformations.PipelineResultTransformation`3..cctor()
       InnerException: 

 


Jun 14, 2010 at 8:44 PM

I get the exception on calling ExpressionObserver.Execute

Coordinator
Jul 23, 2010 at 6:33 AM

I haven't been working with Silverlight 4 yet. Seems a pretty obscure message to me. Did you investigate the issue further? 

Aug 3, 2010 at 3:45 AM

The problem is that

class Generator<TArg1, TType> : IValueTransformationPipelineFactory<Tuple<Func<TArg1, IValueProvider

<TType>>, TArg1>, TType>

Is not declared public, causing the exception noted above and the "Access to method failed" message.

 If you fix that along with all other variations of Generator, then

1. Now variations of Tuple() become the problem. My brute force approach was to declare these public, also.

2. All assemblies that reference obtics must be recompiled.

After these changes, obtics appears to work as normal for SL4.

 

Aug 3, 2010 at 12:32 PM

David, Wil it be possible for you to post a link to the changed src or compiled Sl4 libraries?

Aug 3, 2010 at 9:53 PM

Here is my hack version:

 

http://cid-165ee8545ec28f90.skydrive.live.com/redir.aspx?resid=165EE8545EC28F90!408&Bpub=SDX.Docs&Bsrc=GetSharingLink

 

Note this requires a recompile of concurrent hash collection to sl4 as well. I included that project converted to SL4 in the folder.

Aug 3, 2010 at 9:56 PM

I didn't clean before zipping up, so both the binaries and the source should be included in the above. I didn't thoroughly test this BTW, just my own test app. Also, my changes are most definitely probably NOT the way throb will get this working for real, as this is extremely hacky.