CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeffrey Palermo [MVP]

Software management consultant and CTO, Headspring Systems

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:
  1. Add new web application project to my solution. 
  2. In Win Explorer, copy the entire contents of my web site project to the web application folder.
  3. Delete my web site folder.
  4. Remove the website from my solution.
  5. Show all files in the web application.
  6. Explicitly include everything except \bin and \obj
  7. Add any assembly references necessary to the new project.
  8. Set any post-build events that you've been jerry-rigging up to this point.
  9. Run a build.  You'll notice it fails on control declarations in code-behind files.
  10. 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.
  11. Run the build again.  It passed for me at this point.  I ran my application, and all was well.
  12. 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.



Comments

scottgu said:

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
# May 9, 2006 11:37 PM

Greg said:

Been waiting for this one!
# May 10, 2006 3:43 AM

Danny Chen said:

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
# May 10, 2006 11:15 AM

Justin said:

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?
# May 18, 2006 11:23 PM

Jeffrey Palermo said:

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.
# May 18, 2006 11:36 PM

About Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Check out Devlicio.us!

This Blog

Syndication