VS 2005 Web Application Projects installed! *breaths a breath of fresh air* – level 100
Upon hearing the announcement that Web Application Projects has been released, I wanted to get EZWeb converted
over as soon as possible (I’m close to making another release).
I’d been limping along with the default web site option in Whidbey, and
I didn’t like it at all.
First, you can download the VS 2005 add-in here. There isn’t an automatic port of a VS 2005 website, but it was easy enough to do. Here were my steps:
- Add new web application project to my solution.
- In Win Explorer, copy the entire contents of my web site project to the web application folder.
- Delete my web site folder.
- Remove the website from my solution.
- Show all files in the web application.
- Explicitly include everything except bin and obj
- Add any assembly references necessary to the new project.
- Set any post-build events that you’ve been jerry-rigging up to this point.
- Run a build. You’ll notice it fails on control declarations in code-behind files.
- Right click on the web project and run “Convert to Web Application”. This adds an explicit partial class to your code-behinds that hold your control declarations from the markup file.
- Run the build again. It passed for me at this point. I ran my application, and all was well.
- Run all unit tests and integration tests. They all passed for me.
This project model is so much easier to use for real web applications
(that aren’t just web _sites_). Kudos to the ASP.NET team for
getting this patch out.
If you are using Resharper 2.0 (beta), you’ll notice a slight
difference in navigating to files. CTRL+N will locate the ascx.cs
and ascx.designer.cs files since they are C# code files. To get
to the ascx files, you’ll need to use CTRL+SHIFT+N.
Cool stuff — glad it went well!
BTW — I have VS 2005 Web Site->Web Application Project migration tutorials on this web-site for future folks to use: http://webproject.scottgu.com
Hope this helps,
Scott
Been waiting for this one!
I’m happy to see that WAPs worked so well for you.
But… I’m super-happy to see that you had unit tests and integration suites written to verify your code. I wish more web developers invested time in writing regression suites for their sites, we’d have a LOT less busted websites out there.
—
Danny
Hi,
I followed the same steps you went through .. but i do not have the convert to web applicaiton option available to get partial classes … do you know a way around this?
Justin,
I don’t. I was converting a .net 2.0 website that already had partial classes. Perhaps try the more detailed guide by Scott Guthrie.