Or How To Convert A Visual Studio 2008 Class Library Project To A Web Application Project
This error is one that appears in Visual Studio 2008 when you have a class library project and you wish to create a web user control and you place it in a folder in visual studio instead of the project root. When you want to see the User Control in Design view it can’t. The file itself works just fine. You just can’t view it, which is a bit anoying.
It does not matter if you copied the user control as a whole, created by creating a text file or something else and renamed it blabla.ascx or moved it from project root to a subfolder.
I work with SharePoint, and in SharePoint we replicate a certain folder structure in Visual Studio, so we can simply xcopy our files to SharePoint.
I needed to make a structure with folders that looked like this: TEMPLATE\CONTROLTEMPLATES\Code-Journey\MyUC.ascx inside my Visual Studio. This did not work since the User Control is in a folder and not the root of the Class Project.
At first I thought I had done something wrong, but it seems it’s just Visual Studio 2008 that once again has had some changes that needs getting used to (just like text file encoding for batch files etc.).
I have searched around a lot and I have not found anyone who has a solution other than converting the Class Library Project into a Web Application Project. This works like a charm.
1: Verify problem
2: Unload project
3: Edit .cproj file
4: Add 1 line right after the
Add this line:
5: Reload project
It should work now. This is all I did in my project file.
Basically it was only really a problem if you put your UC in a subfolder, but I sure can’t function very well without doing just that.
Note: Some have seen this exact error and the problem was special characters in the path to the project. Please don’t have “#” or anything like it in your folder names, even though it worked well for you up untill now.
Related posts:









Thanks for this post…. It solved 75% of my prob