CSLA Data Source - Could not load type "[type name] " from assembly "[assembly]"

CSLA Data Source - Could not load type "[type name] " from assembly "[assembly]"

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


blp4383 posted on Monday, February 12, 2007

Anyone know why I keep getting this error when I try to bind a gridview or details view control to a csla data source on my web form?  I am currently using the 2.1.3 Framework. 

Could not load type "[type name] "  from assembly "[assembly]" ... public key token = null

I've searched online and seen similar errors in the past but with older versions of the framework. 

I add the csla data source first, set the TypeAssemblyName and TypeName properties, then drag the gridview control onto my form and attempt to set datasourceID to my cslaDataSource. 

I must be missing a step?  Or not setting a property somewhere? 

Thanks for any suggestions. 

 

RockfordLhotka replied on Monday, February 12, 2007

If you would like, you can try the test version 2.1.4 from www.lhotka.net/cslanet/download.aspx, which may address your issue.

blp4383 replied on Monday, February 12, 2007

Thanks Rocky, I tried it, but didn't see an improvement.  The message did change a bit.  Instead of saying it can't my [type] from my [assemblyName], it says it can't load my [type] from Microsoft.VisualStudio.Web,...

 

xal replied on Monday, February 12, 2007

What are you using for assembly name and type name??
Are you on VS2005 sp1?
Did you go through the "Close all open designers, Clean solution, Close VS, Open VS, Rebuild solution" process?
It is very common for vs to keep old versions of assemblies running around. This is specially true if you added CslaDataSource 2.1.3 to your toolbox and then rebuilt with 2.1.4. Visual studio will still hold the 2.1.3 assembly somewhere...

Andrés

IraD replied on Monday, February 12, 2007

Thanks, yes I did "Close all open designers, Clean solution, Close VS, Open VS, Rebuild solution" process, several times.  My assembly name is the name of my class project and the type name is the name of the class inside the project. 

project name:  TimeCard.Business
class name:  TimeCardCollection

Type Assembly Name:  TimeCard.Business
Type Name:  TimeCard.Business.TimeCardCollection

VS2005, no SP1. 

 

RockfordLhotka replied on Monday, February 12, 2007

Hmm, I am at a loss then.

 

I did JUST put a new 2.1.4 (C# only) online for download. This one has a configuration window (you can click a configure link on the control’s quick access menu) that might help resolve the issue. This configuration window lists all the available business classes referenced by your web site, which helps avoid some issues (like case sensitive type names, etc).

 

Can you try this new version please?

 

Rocky

 

From: IraD [mailto:cslanet@lhotka.net]
Sent: Monday, February 12, 2007 2:36 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA Data Source - Could not load type "[type name] " from assembly "[assembly]"

 

Thanks, yes I did "Close all open designers, Clean solution, Close VS, Open VS, Rebuild solution" process, several times.  My assembly name is the name of my class project and the type name is the name of the class inside the project. 

project name:  TimeCard.Business
class name:  TimeCardCollection

Type Assembly Name:  TimeCard.Business
Type Name:  TimeCard.Business.TimeCardCollection

VS2005, no SP1. 

 



RockfordLhotka replied on Monday, February 12, 2007

You have referenced your assembly in your web project right?

 

And you are specifying the full type name (including namespace) for the TypeName property? Like

 

MyCompany.MyApplication.Customer

 

Or whatever is equivalent for you?

 

When you say [type] in your post, is the control showing your actual type name?

 

Rocky

 

From: blp4383 [mailto:cslanet@lhotka.net]
Sent: Monday, February 12, 2007 1:56 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA Data Source - Could not load type "[type name] " from assembly "[assembly]"

 

Thanks Rocky, I tried it, but didn't see an improvement.  The message did change a bit.  Instead of saying it can't my [type] from my [assemblyName], it says it can't load my [type] from Microsoft.VisualStudio.Web,...

 



IraD replied on Monday, February 12, 2007

Yes, the reference appears to be correct. The control is showing the actual type name.

I should add this - When we add to our project a class module that we wrote in CSLA class, we get the same problem.

When we add our new class module to the project that we build in CSLA class, then it works. Or at least it did before we rebuilt, redownloaded, etc.

The two projects had different versions of CSLA, I think the one built in class was 2.0.x and the new ones have been 2.1.x.

This makes us think that there is some simple specification somewhere that we did make in class, but have failed to make in our later project.

 

blp4383 replied on Tuesday, February 13, 2007

Turned out to be root name space /assembly name confusion.  Sorry to trouble you! 

~ Newbie... 

Copyright (c) Marimer LLC