During converting a large ASP.NET website (more than 500 aspx page and 750 ascx user control) to a Web Application Project in Visual Studio 2010, I encountered many problems and found solutions for them. I’d like to share them with all.
1. Website does not have namespace in projects. While Webproject does have. It’s better to add namespace for all pages and user controls. Namespaces must match physical path of file in the project tree. If you have not enough time to do it for all items you can just find items with same name and change class names only for them. I have added “Page” in the end of class names of pages that were residing in Pages folder.
2. App_code does work. Better to renamed it to something unreserved like WebCode. Check if build action is set to “compile” not to “content”.
3. Take special care for class name of master files.
4. You need to select “convert to web application” by right clicking the web project. It will add designer file for all items. This process is very slow.
5. rdlc reports files (MS SQL Reporting Services client reports) may produce many problems. web.config and other locations must be corrected with newer versions of Reporting Services.
6. Some datasets must be corrected via editing web project csproj file correctly. You must add an entry like following for designer file too.
You can also add a dummy dataset to project and see how it is.
7. Consider having all user controls in the project. In my special case “common” folder added to project too.
8. If you encounter errors like “Element ‘x’ is not a known element” in Visual Studio 2010 you may try this solution.
9. You may need additional tricks. For example create a dummy user control and drag it on the page.
10. Seems all user controls must have namespace
11. Total process may need many tricks. So turn on your innovation!