ASP.NET without Web Projects

This is apparently an old trick, though I learned it 2 days ago, and I'm very happy I finally found out about it. If you've ever struggled with VS.NET and webprojects which have to be loaded from an IIS server, load terribly slow and can't be used with Subversion? Well, check out this link: http://pluralsight.com/wiki/default.aspx/Fritz/AspNetWithoutWebProjects.html. Follow the steps and you'll be webproject free, but you don't lose any functionality.

I turned to VSS again after struggling to get my petshop port under sourcecontrol (due to the .svn folder bug in VS.NET 2003 (hi Microsoft, how about fixing your bugs for a change?), but it was a nightmare, because it added that sourcecontrol crap to the .sln and .csproj files, made files read-only and I had to use the checkout-edit-checkin policy, because that's how SCC integration works within VS.NET. (Yeah, it's really hard to think for another 5 minutes to come up with a more generic approach... ) and no more usage of the lovely explorer integrated TortoiseSVN Subversion client.

I tried Sourcegear's Vault, to see if I could use that instead, but it lacks an explorer integrated client and also has to use the SCC guidelines when used from within VS.NET (that's not Sourcegear's fault though...), so I still have read-only files, checkout-edit-checkin and the SCC crap in my .sln and .csproj files. I could use the Sourcegear Vault client, but it's not as convenient (totally IMHO) as the explorer integrated TortoiseSVN client, where I simply right-click the folder, select commit and it's done.

Be sure to read the complete guide, so you'll be set up for debugging as well. Funny thing is, the original MS Petshop ASP.NET project code already was a library project. I wondered why they did that, now I know. You'd think that if within MS they already are convinced using webprojects is not the way to go, they'd make a simple adjustment to a 2 years old IDE so we could all experience this joy... Fortunately VS.NET 2005 seems to fix this.

9 Comments

  • You can download the "special" version of TortoiseSVN that uses _svn instead of .svn if you like.



    Also, if you want Subversion integration with VS then check out AnkhSVN. It too can also use _svn if you so desire, just edit the config file. It works pretty well apart from trying to rename files with codebehind.



    [)amien

  • There's a trade-off. If you use Fritz's class library method, you do lose some of the visual designer functionality. I used Fritz's method (actually Duckie's modified version) for a while, but went back to the regular way because I preferred having that functionality.

  • Damien: I know, but I have a lot of working folders already with .svn, and I can't have two versions installed.



    Richard: which functionality do you mean? I haven't ran into it yet. (ok the "set as start page" feature, well... I can live without that :))

  • I'd be curious to know what functionality is lost as well.



    We've been using the class library model for web projects for a long time now, never felt that we were "losing" anything.



    I'll admit it's possible though - truth be told, vs.net 2003 mangles HTML so bad that we try to avoid actually using the graphical designer.

  • "truth be told, vs.net 2003 mangles HTML so bad that we try to avoid actually using the graphical designer"



    That pretty much sums it up right there. No need to use the grahpical designer when doing web projects at all...it's an excercise in futility and wasted time as soon as you forget to hit Ctrl+S before intentionally (or worse, unintentionally) hitting the "Design View" tab.



    The only times I ever find the graphica designer useful are for "quick-and-dirty" samples and what not. Otherwise, the design view is to be avoided like the plague.

  • Frans, thanks, you rock for finding this. I gave up hope of this long ago, and thus far I've seen articles talking about the library method but didn't go the extra step of including the wizard functionality (ie. Add New Web Form.)



    So this solves that problem, and it also solves the setup nightmares of developing web apps in a group environment with VS-integrated source control.



    And it solves the horrific way that VS deals with source control on web projects. VS-integrated source control insists on putting web projects hierarchically at the same level as the solution folder. Try to switch the source control structure around and rebind, and you're greeted with "can't load web project" every time you load that solution (which can be worked around by removing and reloading those projects... huge hassle). I'm a big fan of keeping the source control structure a mirror of the file system structure, and it was virtually impossible to do this with VS-integrated source control on web projects.



    And Charles, about the visual designer, it is an real abomination to work with for the first little while, but if you learn to cooperate with it instead of against it, it's actually not too bad. And I even come from the designer dream world of Dreamweaver, and I'm not even aching to go back. This is especially if you wean yourself from being heavily dependent on old school ways of layout design. If you build everything out of the simple, as-nature-intended html elements, then take care of all the formatting and positioning with CSS, then it's an absolute breeze to work with.



    (Except for the occasional lost event bindings.)



    I'm getting with all our employees this next week to convert all of our projects over after I do some more testing on my end.

  • Frans,



    We're using the special "_svn" version of Subversion with no problems. All you have to do is rename all of the ".svn" folders to "_svn". You could write a little script that would do it. Run it once and you're done.

    I just made sure I had the latest version of my code from the repository, did a find for all ".svn" folders, delete them, and then re-checked out my changes. Nooooooo problem. :) I had a problem using Fritz's method, non-visual designer related, but I don't remember what it was. Helpful right? :(

  • Frans,



    I've also tried using Vault with all the IDE integration turned off, using the Vault client instead. In my brief tests, it worked well. I put Vault into "CVS Mode", so that all files were writable. As I saved changes from the IDE, the Vault client would detect the changed files and add them to it's list of changed files. Once I was ready, it was just one button click in Vault to (atomically) check in all my changes.

  • Thanks for the info John, I didn't know that. :)

Comments have been disabled for this content.