Mohamed Meligy on this very topic. Essentially it comes down to a few steps…It wasn’t that many years ago that it seemed like I’d create a new ASP.NET website a few times a week. Some for rapid prototyping and others for release. At the time, the applications felt really easy to manage. That is until they grew and became a beast with all kinds of integration needs. As soon as you start needing to integrate with other systems, databases, applications, etc. the ability to use namespaces and existing components becomes a requirement. Without it, your code would become completley unmanageable with a complete lack of reuse of components and functions. I’m not saying that you can’t maintain some good coding practices within an ASP.NET website, but when the app grows and its being integrated with, I absolutely hate code sprawl. My philosphy on coding is rather simple: Code it once so that you can reuse it at least twice. Obviously not every code block you write will be reused, but say you have a function to get a contact’s name from your CRM system… It would seem like this is something you’ll do over and over and over again, so code it once, use it at least twice… With all that said, the need arose to be able to convert these growing ASP.NET websites into ASP.NET Web Applications. When I got to that point, I was able to find a great resource by
- Create a new blank solution within Visual Studio
- Add a new Web Application Project to the newly created solution
- Import existing website files into newly created Web Application project (overwrite files as needed)
- Manually add references into the new project that you had in your old website
- Once all refernces are added, you likely have many namespace errors. Create the new namespaces as required.
- Now we need to perform a conversion process on the web application project, right click on the new Web Application Project and select “Convert To Web Application”. This should fix missinging designer.cs or designer.vb.