Some asp.net project tips

I'm pretty particular when it comes to how visual studio (vs) handles my project files so how it handles asp.net irks me to no end, but with a little extra work and a few tried and true tricks you can have things your way. These tricks have been around a while, but if you missed them the first time around, here's another chance. I like having my project files all in one place, it just makes it easier to copy or backup projects (not to mention source control). however, by default vs will create the solution files in one place and the web files in other (Inetpub\wwwroot). You can get around this behavior by first creating your solution by opening vs and choosing 'File>New->Blank Solution'. Create your solution file wherever you want (I keep mine in C:\Projects). Now, open up explorer and browse to your new solution's directory, for example C:\Projects\MyWebApp. Right click on the directory and choose 'Properties->Web Sharing->Share this folder' and you will have an IIS virtual directory to work from. Go back to vs and right click your solution in 'Solution Explorer' and click 'Add->New Project' and the new project dialog will pop up. You will only be able to enter the local web path you wish to work from, enter the URL for the virtual directory you just create, in the example above the address would be 'http://localhost/MyWebApp', hit OK, and all of your project files will be created in your application's directory instead of wwwroot. You now have all of your files in one place and can simply zip up the directory!

As an alternative to the directory structure above, I often have multi-project solutions and I usually organize my projects into subdirectories under a main directory, so 'C:\MyApplication\', 'C:\MyApplication\LibApp1', 'C:\MyApplication\WebApp1', etc.

If you deal with large asp.net apps, vs can be painfully slow to open the project. As it turns out, asp.net project are simply library projects that vs just loads  (slightly) differently. If you have a sizable asp.net application, consider converting it to a library application. It's easy, dramatically improves loading times, and makes it much easier to distribute (you don't have to have IIS mapping in place to work on the application). Fritz Onion had created a simple guide.

Print | posted on Monday, May 03, 2004 8:31 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)
 
Please add 2 and 3 and type the answer here: