Jan 15 2007

Visual Studio 2005 Web Application Project

Posted by admin under ASP.NET 2.0

The web site project type in Visual Studio 2005  sure differs from the web applications you created in VS2003. App_Code directory for example - and the first thing you might find out when you are finally done woth your solution is - wher are the DLL:s to upload to the webservers bin directory??? I.e you need to Publish website - and with that you get the whole website compiled and copied to another directoy ( a pain if you have a lot of things in your app_data directory for example) - and after that you can FTP it up.       

And more - the dll:s created are often named strangly :

This is how it looked on my production server yesterday - I needed to do some fixes on a site I run and I had trouble getting it to run correctly on the webserver, therefore I uploaded the site multiple times - and in the rush I didn't have "time" to delete the old files. And since the files are named differentlt on each rebuild I ended up with LOTS of files.

Then I decided: I need to do something about it. The solution is to "go back" - not to VS2003, but to the project type used in VS2003. Scott Guthrie has created a download (check out the links section) - and with that you get a new project type:

  

And this will result in a "regular/vs2003 styled" project with a single dll. No app_code directory - but still all other features such as themes etc is working.

Be sure to read the docs on Scotts site though - cause it needs some manually tweaks for debugging to work etc. 

I tried to convert  this site - which is a fairly small project (around 10 aspx pages), master pages is used, a few third party components and a separate BLL/DAL. I did have some trouble at first - some pages didn't get converted when I did "Convert to web application" - and I needed to scratch my head for a while before I understood that. All ASPX/ASCX files should have a .cs AND a .designer.cs file - that's how you can check the status.

No idea why it didn't work - however I jusr rightclicked on the files and ran the "Convert to web application" again for these files - and now it did  work.

 

Links