I am getting this error on InitializeComponent of my XAML code behind that has the CslaDataProvider. I think I check everything and can't seem to figure out what could be causing this issue.
Environment: CSLA 3.8.2.0 (Both light and Core), Windows 7 Ultimate, VS 2010 Beta version, .NET 3.5, Silverlight 3
Thanks.
Hello,
Can you please provide a full stack trace for this error, also if you could attach a screen shot of your project references that would be great.
Thanks
-Blake Niemyjski
Thanks for the prompt reply.
I'll provide the stack and the screen shot as soon as I find how to post a screen shot in this forum. I have the simplest one table and one column that I am trying to retrieve and show in a Silverlight screen using CSLA. Our company is moving to use Silverlight and convincing them to use CSLA. However, I find that nothing seems to work for me. I followed the video and the Rolodex sample. What I did basically is build a Silverlight Navigation Application then created my business objects, one inherited from ‘ReadOnlyListBase’ and the child from ‘ReadOnlyBase’. Proceeded to create the client side of the business objects using the Add link under a Silverlight Class library. Then on my XAML, use the csladataprovider. When I was debugging it, the reflection gettype is failing to load the assembly.
Our company is moving to use Silverlight and convincing them to use CSLA. However, I find that nothing seems to work for me.
epabx system
commercial telephone systems
telephone system installation
Hello,
If you can provide a sample solution that isn't working for you that works the best. Then we can debug it on our end and get it resolved for you guys. The quickest fix without taking a look at the references or stack trace would be to make sure that the CSLA assembly or the assembly in question is in the GAC (Gacutil -i csla.dll) as well as bin folder of your application. If you are still having issues, one of the quick fixes would be to tie into the AppDomain.AssemblyResolve event.
Thanks
-Blake Niemyjski
Hi,
Thanks for the offer. How can I can send a sample solution?
Let me know.
Thanks again.
When I was debugging it, the reflection gettype is failing to load the assembly.
What is the type name you are providing to the CslaDataProvider? It must be in the form "Namespace.Class, Assembly" or it won't work. The most common issues are missing the assembly name or mis-typing the namespace.
Of course the Silverlight application must reference the business project so the business DLL is included in the xap file - otherwise the type won't exist on the client at all.
The type name I am providing is correct. However I noticed that the version number in the error message is 0.0.0.0 not the 1.0.0.0 I was expecting. Could that be a clue to the issue?
Thanks.
Hello,
That could be the issue, can you please paste the type name you are passing in. You can attach a solution by logging into the forum and selecting add a file attachment in the options tab when you are writing a message.
Thanks
-Blake Niemyjski
The type name I am providing is correct. However I noticed that the version number in the error message is 0.0.0.0 not the 1.0.0.0 I was expecting. Could that be a clue to the issue?
The Silverlight Type.GetType() method doesn't work the same as the .NET one - in particular it can't actually handle type names like "Namespace.Type, Assembly". It specifically requires the version, culture and other long-form parts of the type name - again, unlike .NET.
So CSLA .NET for Silverlight helps solve the simple case, by detecting the short-form name and appending the most common (neutral) version/culture/etc. If you aren't explicitly signing or versioning your assemblies this works great.
Of course if you sign or version your assemblies then you need to provide the full type name with all the explicit information, because Silverlight doesn't offer any way to auto-detect that information.
Hi,
I finally got it to work on my MS Sql Server and the reason for the initial failure is my failure to reference the Silverlight business class library in the Silverlight Client as pointed out by Rocky.
Thank you so much as this brought back confidence on our pursuit to have our first CSLA and Silverlight project.
However, now that it I have proven that it works on my personal laptop using MS SQL Server, I now have to move it to our Sybase database environment at work. When I did this and made all the necessary changes for the database connection. I start getting the following error.
I wish I can get the this to work too.
Thanks again to both Rocky and Blake.
"An exception occured during the operation, making the result invalid. Check InnerException for exception details. "
When I tried to view my svc file in the browser to test, I get the following error instead of the usual message.
Description: Could not load file or assembly 'CQLA' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'CQLA' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
|
|
|
What is Cqla? Looks like a typo...
I searched everywhere and can't find that CQLA word either. My first thought exactly that at first, that it's a typo but it doesn't seems to be.
From the exception, it looks like the typo is in your WCF svc file or web.config, but the global file search will find it for you.
Hi Rocky,
I did a global file search as you suggested and the search did not find anything that has the word cqla. This application works in MS Sql Server which makes me think that the WCF svc file or web.config is unchanged besides the connection string. The error I encounter when running the application is
"An exception occured during the operation, making the result invalid. Check InnerException for exception details. "
In debugging this, the application does NOT reach the business object server side DataPortal_Fetch(). I'll try to step in deeper into the debugger but appreciate any tip or suggestions.
Thanks,
Nino
Hi,
I finally got this thing working. Appreciate all the replies. Those replies showed me places to look at which resulted well.
In short, the solution I found on my Sybase environment is to remove the wcf host and move the svc file in the web host. I think the cross domain is what's causing all the issue. I am guessing of course but at this point, all I wanted is to have some success to convince my group to move forward on our CSLA and Silverlight project.
Thank you so much!!!
Nino
Besides giving the detail Blake requested, I think the recommendation is to no longer use CslaDataProvider but instead go the MVVM route. That component will be removed I believe just after Csla 4.0.
Copyright (c) Marimer LLC