I'm not new to CSLA, but I've sure been away a LONG time.
I tried today to follow the installation instructions (the most recent I can find here) that are aimed at CSLA 3.6 and VS2008. But I was doing it with the 3.83 download and VS 2010. It was dreadful.
I'd be happy to pay a reasonable rate to somebody who can accept an invitation for a remote connection to my workstation (Windows 7 64-bit with 8 GB RAM) and spend an hour or so with me to get the framework and samples working (including set up of the IIS 7 support needed for the sample web projects). I've already downloaded them and set up the recommended folder structure.
Any takers? Or should I just put a call in to Magenic?
The IIS7 stuff is a pain.
You should start be making sure the non-web samples work - that will establish that you have CSLA built and all the folders in the right relative locations.
The biggest issue I encounter with IIS7 is that the default app pool typically doesn't have access to any of my folders. The easiest solution (right or wrong I really don't know) is to create a new application pool that runs under your user id. Then have your web apps run in that app pool, and thus under your user id. That way they have access to your personal folders, which is probably where the samples are located.
I'd feel a lot more confident implementing this advice if the only other time I've ever used the IIS manager wasn't to set up CSLA for 1.5 about six or seven years ago
So I should try it again? And do I build the cslacs.sln solution (that was called csla in the directions)? Or should I be trying to build the cslacs-build.sln?
I'll post my results in the morning. I expect they will include another plea for that remote connection assistance, but we'll see.
Build cslacs.sln. The other solution was created to drive a build server (which has since died), and it almost certainly won't work outside that server.
Thanks, Rocky. I went through the process again and built cslacs.sln in each case.
Step 1: no problem. Step 2: I used our own key file per step 2a and will follow 2b and 2c, of course. I'm not sure what the counsel in 2d really means, but it looks like choices I'll make once I'm in a project that references CSLA (with the appSettings, right), so it shouldn't affect my steps at installation here. Built debug solution. Then I used ConfigMgr to change to Realease mode and did step 3, Build Release solution. I'll take care of referencing the custom controls in the toolbox (step 4) when I get PTracker open.
Steps 1 and 2: no problem, really. VS2010 converted ProjectTrackervb.sln and offered only two warnings -
Converting deprecated dbp file 'C:\Visual Studio Projects\csla\samples\CslaNet\vb\ProjectTrackervb\PTData\PTData.dbp' to 'C:\Visual Studio Projects\csla\samples\CslaNet\vb\ProjectTrackervb\PTData\PTData.dbproj'
Your project is targeting .NET Framework 2.0 or 3.0. If your project uses assemblies requiring a newer .NET Framework, your project will fail to build. You can change the .NET Framework version by ...
And both of these seem OK. If I want to use .NET 4, obviously I'll have to install CSLA 4; makes sense.
Steps 3 and 4 (that involve IIS) are going to be challenging for me, but your advice above to be sure and get PTWin working first is a great idea. So I tried that first.
And I'm having no luck with getting it to work, even after moving the mdf/ldf files to my SQL Server's data folder and trying (apparently unsuccessfully) to attach them. I can negotiate the login in screen as pm/pm, but it shows that I'm not logged in and any attempt to use menu items throw authentication exceptions. On stepping through the code, it sure looks like a problem with wcfHost, but I can't figure out how to execute the instructions in step 3, even with your suggestion above. (Hell, I can't even find a valid user name to use instead of the default ApplicationPoolIdentity.)
Any ideas on where to go from here?
I feel increasingly in need of hand-holding. I don't expect you have the time for it, but I'm hoping somebody reading this wants to sell an hour or so of their time to repeat something they've obviously done successfully in their own environment. Any takers?
don't know if this will help - but on Vista (maybe Win7) I had to 'unblock' the mdf file (and some other dll's) via file properties as they became 'blocked' when downloaded from internet. Don't know of this applies to you here?
FYI, I unblocked the zip fie before I unzipped the contents and I belive that eliminated this potential problem. I don't have an Unblock button available when I look at these files' properties.
FYI, even though the attachment attempt failed, when I attempt again subsequently, it tells me it is failing on a CREATE FILE method because the file is already open in SQL Server (even though it doesn't show up in the list of databases... even when logged in as the sa account). And when I try and delete the copies that are there (in the SQL data folder), Windows balks and tells me that they are open in SQL Server, too.
I also tried detaching by executing sp_detach_db, but, of course, it failed complaining that the database doesn't exist.
Although I hate how superstitious it sounds, I think I'm going to reboot and see if it clears up some current confusion on Windows' part that the file is open in SQL Server even though it is not.
After rebooting, the databases show up in SQL Mgt Studio with their file names, no doubt caused by the connection string with the syntax that was so odd-looking to me (i.e., the part with AttachDbFilename= in it).
Now I'm wondering if the .\SqlExpress should have been left in there, too. Is that a shortcut expression to whatever server is available?
and moments later... YES!! It's working. When I (a) restored the connectionstring all the way back to its default value from the original download AND (b) commented out the CslaDataPortalProxy key in the appSettings section in the app.config file (the one for WcfProxy was the only one of the four there that wasn't already commented out), I get logged in correctly and can see the Projects in search window when I choose the Edit Project menu item in PTracker.
I'm perplexed by the fact that the copies of the db files in the SQL Server data folder still appear to be in use by SQL Server, though. Clearly the files in use are the ones in the C:\Visual Studio Projects\.... folder location. I'm also a little confused by the different path values for the databases in the SQL Mgt Studio.
Here are the three values shown in app.config:
PTracker: C:\Visual Studio Projects\csla\Samples\CslaNet\vb\ProjectTrackervb\PTracker.mdf
Security: C:\Visual Studio Projects\csla\Samples\CslaNet\vb\ProjectTrackervb\Security.mdf
PTWin.My.MySettings.PTrackerConnectionString: C:\Visual Studio Projects\csla\Samples\CslaNet\vb\ProjectTrackervb\PTData\PTracker.mdf (which doesn't even exist???)
The value for the path for Security in SQL Mgt Studio looks the same as it does in app.config. But the one for PTracker is:
C:\VISUAL STUDIO PROJECTS\CSLA20\PROJECTTRACKER20VB\PTRACKER.MDF
Why are those twenties embedded in the path name? There is no ..\CSLA20 or ..\PROJECTTRACKER20VB path on the machine. And why does the connection work from the PTracker app when the DataSource name doesn't really match what is in SQL Server for the PTracker db??
If you have time to answer these, great. But I'm just glad to be able to be running PTracker again after these too many years <g>. For now I'm going to get back to the video series and try and get up to speed. btw, if you haven't seen these and you're reading this because you're fairly new here... get them. They're terrific.
When you said that VS had to upgrade the solution, that's when I realized what you were doing.
ProjectTracker in C# only partially works in CSLA 4. ProjectTracker in VB probably won't even build, much less run.
ProjectTracker is an odd duck. It is a "sample" but really it is part of the Expert Business Objects books. And I update that "sample" as part of the book project, not part of the CSLA dev work.
I'm not 100% sure I'm going to keep it going forward, though I might. Certainly I'll need a sample for the new ebook series. Right now I'm working on the CSLA 4 Overview ebook, which is more concept heavy and less code heavy - so no sample is required quite yet. But as soon as I get into subsequent ebooks I'll be using a sample (one or more samples actually). That might be an updated ProjectTracker, or it might be something else - depends on how bored/frustrated I am with PTracker when I get there :)
In any case, that's not a good sample to be looking at for CSLA 4 - at least not in VB. It is the only sample for ASP.NET MVC 2 in C# right now - though that should change in the next couple weeks when Gary gets his new MVC sample into svn.
Copyright (c) Marimer LLC