My CslaDataSources Stopped Working after VS2005 SP1

My CslaDataSources Stopped Working after VS2005 SP1

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


Jav posted on Thursday, January 11, 2007

I use Csla 2.1.1

Installed VS2005 SP1 this morning.  Have spent the rest of the day trying to figure out why all CslaDataSources in my Web project have totally become dysfunctional in the Design mode.  Interestingly, the program runs just fine.

In the Design mode, everyone of my DetailsViews and FormViews - the Controls populated by CslaDataSource - fail to display in the normal form.  Instead, I see an error message that a certain assembly of mine cannot be found.  Sometimes the message is a little more elaborate and tells me the location where the file is not found:

"C:\Documents and Settings\Javed\Local Settings\Application Data\Microsoft\VisualStudio\8.0\ProjectAssemblies\e0rm2dik01"

Interestingly, when I take a peek inside that folder, I do not find the file that VS is looking for. Instead I find a different dll from my Solution (Each one of the folders in this location have a single dll.  It looks like the VS is looking in the wrong folder (now go figure!!)  I use many ObjectDataSources with my NameValueLists, and they are all working fine.  When I place a new CslaDataSource, for the same NameValueList, and try to attach iy to a Control, I get loud beep and an error message of the kind above.

Here is what I have done:  I have gone through every one of my BusinessObject projects, carefully looking at all its References, removing all unused References.  I have used the Clean Solution Command with no errors of any kind.  I have built and re-built my Solution.  I have cleaned out the Internet cache (or whatever it is called).  None of them have helped. 

I will appreciate any suggestions.  Thanks

Jav

rlarno replied on Friday, January 12, 2007

Jav,

I'm using VS 2005 (Team Edition for Developers) SP1. But I am not seeing any issues with the CslaDataSources with DetailsViews.

I know this does not help directly, but maybe it is not related directly to the SP. If you have a sample project that repro's the issue, I'll be happy to try it out to.

skagen00 replied on Friday, January 12, 2007

Just to chime in to say that I'm not experiencing that problem either.

Jav replied on Friday, January 12, 2007

Thank you for the responses.  Can you both do me a favor.  Can you re-build your solutions and then take a look.

I opened the ProjectTracker solution and indeed everything looked fine.  But as soon as I re-built the solution all of the DetailsViews shrank into gray boxes, showing only an error message.

I am not knowlegable about the mechanics of how things are handled in the following folder(you have to enable viewing of hidden files and folders in Folder Options dialog to see the Local Settings folder):

C:\Documents and Settings\<user name>\Local Settings\Application Data\Microsoft\VisualStudio\8.0\ProjectAssemblies\

My guess is that each time a solution is built, a folder in that location is allocated for all (my guess) of the dlls in the solution. But now a given folder contains only one dll, thus distributing my 9 dlls into 9 folders.  If CslaDataSource is somehow using this set of folders at design time to find the dlls, this may be causing the problem.  I can fix the problem momentarily by manually copying all of my dlls into each of those folders and then closing and reopening my .aspx file.  But when the solution is built again, the problem comes back.

Any ideas?

Jav

skagen00 replied on Friday, January 12, 2007

In your Web Site's property pages, how do you have your reference for CSLA configured? Are you having it look at an old version of the CSLA framework by any chance?

I suspect that isn't the issue but I'm afraid that's all I would have to offer for you. I am able to rebuild without any problem...

 

RockfordLhotka replied on Friday, January 12, 2007

Do you have the Csla project in your solution? If so, remove it - that will cause no end of pain and suffering. When using CslaDataSource you MUST build Csla.dll as a separate solution and reference only the DLL from your business/UI projects.

skagen00 replied on Friday, January 12, 2007

That's an interesting comment, Rocky. I've had CSLA as a project in my solution for as long as I've been building my product - I did it as it allowed me to skip through CSLA in the debugger. I haven't encountered any problems yet with doing this...

Maybe I'm missing something, or I've just been fortunate.

(This may be a novice question but can one skip through CSLA in the debugger without having it as a project?)

Jav replied on Friday, January 12, 2007

Rocky,

I have never included Csla as a project in my solution.  When it comes to that, I am sort of a purist - always trying to do things by the book. 

I have 2 Solutions in my Projects folder, a Windoes Forms App solution and a WebForms App solution.  Right now I am only working on the Web App. 10 of the projects are common to the 2 solutions. Everything is in a VSS database, I have simply checked those projects out into the Web App solution.  I have had that arrangement for almost 8 months anf everything worked fine until yesterday when I applied the SP1.

I don't know if you saw in my earlier note, I am seeing the same problem with the ProjectTracker.  When I first opened it, everything looked fine.  When I re-built the solution, the problem surfaced.

Jav

RockfordLhotka replied on Friday, January 12, 2007

Jav:

I don't know if you saw in my earlier note, I am seeing the same problem with the ProjectTracker.  When I first opened it, everything looked fine.  When I re-built the solution, the problem surfaced.

I don't know what to say. I have SP1 installed, and have had for a while now on both my desktop and laptop, and I haven't seen an increase in CslaDataSource issues.

When I say "increase" it is because I have run into this issue (or similar ones). Almost always it is because I've rebuilt Csla.dll and VS got confused (see my previous post). The solution is:

  1. Close all designer windows in your solutions
  2. Close all VS instances
  3. Open VS and your solution (no designers open)
  4. Rebuild all (not build - RE-build, especially in C#)
  5. Close VS
  6. Open your solution and your designer

This has resolved, for me anyway, a confused VS on numerous occassions.

Jav replied on Saturday, January 13, 2007

Rocky,

I created a new Solution with only a single Class Library project (TestLib) with one object, Customer, based on Northwind Customer; and a Web Project with only the Default.aspx page.  Once everything was building without errors, I followed your steps exactly.

After the last step, I added a CslaDataSource, set the TypeAssemblyName and TypeName properties, dragged a DetailsView.  When set the DataSource to CslaDataSource, I got the same type of error message that I have now seen innumerable times.

It then occured to me that I am using Web Application Projects instead of the standard WebSite projects.  (As you know, prior to SP1, Web Application Projects were an add on, with SP1, the capability has been built in.)

Realizing that, I decided to add a standard WebSite project, and installed the same on the Default.aspx - and lo and behold - there is no error.   I then went back to the WAP project, and this time even that has worked. 

I don't know if it will continue to work with my real projects - and I also do not know if the type of website had anything to do with this, but I thought I will share this bit of info.  Right now I dare not close this Designer window (After 72 hours of turture, I am afraid to)

Is there any way to walk through the debugger in the Design mode?

Jav

Jav replied on Saturday, January 13, 2007

Yes, there is a problem with WAP.  I closed the Solution with my two Web Projects.  When I opened it again, the WebSite default page looks fine, the Web Application Project Default page display the shrunken, miserable looking DetailsView that I have now seen a thousand times.

With 80% of our time spent batttling the bigger and better woes Microsoft's newest technologies are unleashing on us, the productivity is spiralling downwards instead of improving.  Are there any people actually doing productive work with what we have today, or is everybody just writing flowery stuff about what is to come in 2 years and beyond!!

Jav

RockfordLhotka replied on Saturday, January 13, 2007

I knew this was a risk when I did what I did. As I have said many times, this ability to load type information on the fly is a hack because there is no supported solution. It sounds like I will need to revisit this once the ebook is out.

Rocky

-----Original Message-----
From: "Jav"
To: "rocky@lhotka.net"
Sent: 1/13/2007 11:24 AM
Subject: Re: [CSLA .NET] My CslaDataSources Stopped Working after VS2005 SP1

Yes, there is a problem with WAP. I closed the Solution with my two Web Projects. When I opened it again, the WebSite default page looks fine, the Web Application Project Default page display the shrunken, miserable looking DetailsView that I have now seen a thousand times.

With 80% of our time spent batttling the bigger and better woes Microsoft's newest technologies are unleashing on us, the productivity is spiralling downwards instead of improving. Are there any people actually doing productive work with what we have today, or is everybody just writing flowery stuff about what is to come in 2 years and beyond!!

Jav

Jav replied on Sunday, January 14, 2007

Thanks Rocky,

For now I have just gone back to the original VS2005.  Seeing my Forms open up again has been a sight for sore eyes. I don't think SP1 had offered anything else that I needed.  I can wait for SP2 which out to be out by early 2008.

Jav

xal replied on Friday, January 26, 2007

Can you confirm that removing sp1 "solves" it?
I'm having the same issue, csladatasource is complaining about not finding ActiveObjects here... :(


Andrés

Jav replied on Sunday, January 28, 2007

Hi Andres,

Yes, getting rid of SP1 did the trick- but I do not believe that you can remove or uninstall SP1. 

What I did was to completely remove VS 2005.  Then I pulled out my "brand new" dvd - hot off the press and sent by Microsoft the previous week (as a reward for my renewal of subscription) - but containing exactly and absolutely the same version of VS2005 that they sent me a year earlier.  I re-installed the VS followed by all the hot packs (4-5 of them) that I had installed before.  I have had no problem working with Csla ever since.

Since none of the hot packs caused a similar problem, I am inclined to think that this is some last minute change the folks at MS made before releasing SP1.

As I stated in my last post, if your object library is a single assembly, you will probably not have any problem.  The error, almost always, relates to the Assembly of the Parent of the class that you are using on you Web Form.  That is the reason why ActiveObjects is the "commonly accused" entity.

Good luck

Jav

xal replied on Sunday, January 28, 2007

Yes, you can uninstall the sp. You need to check the "Show updates" checkbox in the add remove programs dialog and it will show up right under visual studio.

Anyway, I've been in touch with Rocky during the past couple of days and I've found a solution that might solve most of the gripes the csladatasource has been causing. It's already in his hands, so stay tuned for a followup on the csladatasource...

Andrés

Matthew Sorvaag replied on Tuesday, February 06, 2007

Hi Guys,

Has there been a fix released for the datasource issues? If so, where can I get it as the current one I have is making my life hell! (I downloaded the latest version of the framework, 2.1.3 running on Vista)

Are there any interim tips on how to get around the "file not found" issues? I am using a WAP project with 1 class library referencing a release version of the CSLA DLL.

Thanks,

Matt

xal replied on Tuesday, February 06, 2007

There's a sticky post at the top of the forum about a 2.1.4 pre release...
Get that one.


Andrés

RockfordLhotka replied on Tuesday, February 06, 2007

Just last night I posted a test version of 2.1.4 that (I hope) addresses all these issues. Please give it a try and let me know how it works for you.

 

Thank you, Rocky

 

From: Matthew Sorvaag [mailto:cslanet@lhotka.net]
Sent: Tuesday, February 06, 2007 7:11 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] My CslaDataSources Stopped Working after VS2005 SP1

 

Hi Guys,

Has there been a fix released for the datasource issues? If so, where can I get it as the current one I have is making my life hell! (I downloaded the latest version of the framework, 2.1.3 running on Vista)

Are there any interim tips on how to get around the "file not found" issues? I am using a WAP project with 1 class library referencing a release version of the CSLA DLL.

Thanks,

Matt



Matthew Sorvaag replied on Wednesday, February 07, 2007

Thanks Rocky.

I think this is a great framework and have bought both your books!
I will try out the new release this weekend.

Thanks,

Matt

Matthew Sorvaag replied on Sunday, February 11, 2007

Hi Rocky,

I have been using 2.1.4 and I can confirm that the asp.net datasource is working much better.

Thanks,

Matt

RockfordLhotka replied on Sunday, February 11, 2007

Thank you Matt, I appreciate the feedback!

 

I’m about to do another test release of 2.1.4 (C# only) with another set of changes to try and fix the ability to create a new instance of the control via the DataView and GridView controls. At the moment though, I’ve run into a snag, which appears insurmountable. But we’ll see J

 

Rocky

 

From: Matthew Sorvaag [mailto:cslanet@lhotka.net]
Sent: Sunday, February 11, 2007 1:35 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: My CslaDataSources Stopped Working after VS2005 SP1

 

Hi Rocky,

I have been using 2.1.4 and I can confirm that the asp.net datasource is working much better.

Thanks,

Matt



Jav replied on Saturday, January 13, 2007

Rocky,

I have now done some more tests with my tiny project. Each time I make a change, I close all designers, Re-build solution, Close VS, Restart VS, Open the Designer.

1. Website projects a little easier to work with that WAP, but both show problems.

2. With a single Library project, things work pretty well

3. Then I added a second Library, and added to it a SubClass of Customer - SubCustomer as follows:

<Serializable()> _
    Public Class SubCustomer
          Inherits TestLib.Customer


    Public Shared Function NewSubCustomer() As SubCustomer
        Return CType(TestLib.Customer.NewCustomer(), SubCustomer)
    End Function

End Class

4. I added a new Page to the WebSite project, Added CslaDataSource using the SecondLib, SecondLib.SubCustomer, placed DetailsView on the Page to use this CslaDataSource.  Immediately I got an error that TestLib cannot be found. 

It seems that it is always the Library that contains the Parent Class of the Object that I am trying to use in the CslaDataSource which "cannot be found"

Conclusion: Single Class Library Solutions seem to work fine.  When there is more than one Class Library, things invariably fall apart.  I will be happy to email you this little Project if you like.  The error mesages are very consistent.  (BTW, yesterday, I completely uninstalled my VS2005, and reinstalled it followed by SP1. It has made no difference)

Jav

 

Jav replied on Friday, January 12, 2007

I have gone over all of the references in all of my projects multiple times.  In fact I removed those references and then added them very carefully. 

The error message shown in the DetailsView, or FormView, is always concerning one or the other of the 2 topmost Libraries in my solution.  The message always says that it cannot locate a given dll.  As I mentioned in my first post, my App runs just fine - so there is nothing wrong with the inner workings at all. 

During the pre-release phase of Csla 2.0, we had a similar problem with CslaDataSource at the Design time.  Rocky fixed it (I don't know how) in a later version.

Jav

RockfordLhotka replied on Friday, January 12, 2007

As long as you reference Csla.dll that is built for debug, and the associated pdb files are in the folder with Csla.dll then you can walk through the CSLA .NET code without having the project in your solution.

The problem with having the Csla project in your solution is that any accidental rebuild of Csla.dll can seriously confuse VS. Remember that CslaDataSource comes from Csla.dll and is loaded by the IDE. Once loaded, an assembly can't be unloaded - so VS loads a version of Csla.dll and is stuck with that version until you close VS.

If you subsequently rebuild Csla.dll, VS will still use the old one - but the CslaDataSource will accidentally use the newer one when it reflects against your business object. This will cause failure.

pelinville replied on Friday, January 12, 2007

Check to see if you have any reference paths declared.  You can add and remove the references all you want but if you have those paths designated it will always try and go to path designated.
 
At least that is what happened to me once.

Copyright (c) Marimer LLC