Friday, June 29, 2007

Proven: Visual Studio .Net 2003 Pro with Visual SourceSafe 2005 works

I just tried and found it was successful: Visual Studio .Net 2003 Professional can work with Visual SourceSafe 20o5. Awesome. So I don't have to upgrade to VS.Net Enterprise edition, since all I care is the SourceSafe feature.

Thursday, June 28, 2007

Version Controlling SQL Server 2000: Real World Experience

Finally, thanks to the MSDN document ("How to add SQL Server 2000 Stored Procedures to Visual SourceSafe by using Visual Studio .NET"), I successfully version controlled the staging database for the production SQL Server. Here's some of the experience that I gained along the way:

- Pay extra attention when entering the Source Control Project (Directory) Name for the database. DO NOT put $/ in the beginning, or otherwise you got tons of freaky error. So like if you want to put stuff in $/Staging_Database , just put "Staging_Database"

- The version control is done within VS.Net 2003 IDE, under Server Explorer-> Servers-> [whatever SQL Server you registred]. If things goes right, you can see the menu item "Add To SourceControl" will show up when you right click on the Store Procedure, or in each Store Procedure item.

- To version control your SQL Server, you HAVE to have VS.NET Control Server components installed on your SQL Server. Otherwise, you won't see the "Add To SourceControl" menu item showing up.

- I am a bit puzzled about why they only allow us to version control Stored Procedure. There are other objects in database that are worthy of version controlling, like table structure and such. Oh well.

- When a stored proc is version controlled, you will see a tiny lock in the SErver Explorer view.

Now I know why "Application Pool" is a selection

I never tried to run two different version of APS.Net (1.1 and 2.0) on the same box, thus when I do such thing in the production box today, I saw something funny like this when I tried to access the ASP.Net 2.0 site that I deployed:

-------------------- (start) -------------------
Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
--------------------- (end) -------------------------


So I followed the instruction and check the Application section of Event Log on the web server. Here's the message I got:


-------------------- (start) -------------------
It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
--------------------- (end) -------------------------

I see! And the solution is so simple! I went to MMC, right click on Application Pool section under IIS, and select [New][Application Pool ...] . I picked the "Use default setting" one and clicked OK. Finally I went to my web app and set the Application Pool of my web app to use the newly created Application Pool. Result? A successful ASP.Net 2.0 deployment.

Deploying ASP.Net 2.0 Application

I have to admit that the logistic of messing with ASP.Net 2.0 is pretty new to me, but now that I have a chance to do the study and actually try out deploying ASP.Net 2.0 in a production environment, I don't want to pass the opportunity. Here are the steps and some tidbits about how to get it working:

- First finish the web application in Visual Studio .Net 2005
- Use Deploy Site to deploy the clean files (without source code and such) into a directory.
- On the server, created a new virtual directory, and set it to run ASP.Net 2.0
- Copy the files to the virtual directory.

If something failed, then maybe this is the first time the site having ASP.Net 2.0 deployed. You can fix the problem issues accordingly.

- If you got "Page not found", it's possible that ASP.Net 2.0 scripts was not being installed properly. First change directory to "drive:\%windir%\Microsoft.NET\Framework\v2.0.50727" then execute "aspnet_regiis.exe -sn W3SVC/1/ROOT/YourNewAppVirtualName". The problem should be fixed by then. [Reference]

- If you get "The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'." error, then need to make ASPNET account to have all the right on the "Temporary ASP.NET Files" directory. Make sure that you set it so that all the child folder also have that kind of privilege. [REference]

I can foresee that more prblem will be coming but ... oh well .. one at a time.