Team blog of MCS @ Middle East and Africa

This blog is created by Microsoft MEA HQ near shoring team, and it aims to share knowledge with the IT community.With its infrastructure and development sides,It brings to you the proven best practices and real world experiences from Subject Matter Experts
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

How to Convert Web Site To Web Application

How to Convert Web Site To Web Application

  • Comments 1
  • Likes

 

In earlier post, I have explained the motives behind converting web site (WSP) to web application (WAP). In this post I will detail the steps of conversion.

Before talking about steps, it is important to mention that, steps listed below are for a web site that is located in Team Foundation Server (TFS) 2010 repository. So, when converting, we need to make sure, the source history is also carried out.

Preparation on current WSP:

  1. Make a conversion plan and Inform your team members.
  2. Clean-Up: Remove all garbage stuff in WSP, if any.
  3. Services: Add service references from service location.

Steps for conversion:

  1. Create a branch from the team project your WSP located in. I named it ‘TP2’ here for reference purposes.
  2. Create a web project and solution named. I  named it ‘WAP.Web’ for reference purposes.
  3. Add a new class library project called WAP.Web.Library.
  4. Add a new folder called "Assemblies" into root level, then add a new folder called "3rdParties" here. Add all 3rd party references into 3rdParties folder, all other dll referenced by the project here.
  5. Run tfs command, "tf move $/TP2/Old_WebSiteCode/* $/TP2/WAP.Web/WAP.Web to move files into new project along with their history.
  6. Run tfs command, "tf move $/TP2/WAP.Web/WAP.Web/App_Code/* $/TP2/WAP.Web/WAP.Web.Library" to move files into new project along with their history. It is a good practice to place all the files located in App_Code folder in WSP into a class library project.
  7. Build WAP.Web.Library
                    1- Include all folders into the project.
                    2- Add references from dlls in Assemblies and/or 3rdParties folders.
                    3- Add web references by giving service locations for each service used in the application.
                    4- start fixing error one by one till built succeeded.
    8- Build WAP.Web:
                    1- Include all folders into the project.
                    2- Add references from dlls in Assemblies and/or 3rdParties folders. Build it, make sure you have errors only related to "missing …designer.cs files".
                    3- Run "Convert to Web Application" from VS 2010         
                    4- Start fixing error one by one till built succeeded.

Once, it is all good, you may strengthen more your project structure by adding namespaces in CodeBehind files.

Conclusion

The most common issues in converting web site to web applications are missing assembly references, missing namespaces, incorrect @CodeBehind directives on .aspx and .ascx files.

References

  1. Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio
Comments
  • thanks 4 helping

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment