Transferring a web application project to a website is not so difficult, but may have several fixes. However, keep in mind that website designs have certain disadvantages. Their folder folders are messy, code reuse is more difficult, with the exception of a disciplined software architect, websites cannot use MSBuild events before and after assembly, etc.
Some things to consider when converting a site:
- Create a new website in a different folder and copy the appropriate files into it. It is not practical for a web application project and a website to coexist.
- Websites do not use the .designer.cs file for custom controls, master pages and pages, so you can destroy them.
- All codes that do not contain a code must be moved to the App_Code folder or to the library with links so that they are accessible to all pages.
- Web service code encoding must be moved to the App_Code folder.
- Service links must be removed and rebuilt.
- Re-add the links to the website, as for the web application project.
- No need to strictly declare namespaces for code-based classes, but it is also not necessary to delete existing namespace declarations.
Most likely to bite:
- Pages no longer know about each other. In a web application project, all the code is in one assembly and therefore easier to share. There is one assembly per directory / subdirectory on the website.
source share