Skip to content


Error Creating Control – Cannot Find Web Project File in Visual Studio 2008

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

UserControl - Solution Explorer

Solution Explorer

User Control - Working from root

Working from root

User Control - Not working from subfolder

Not working from subfolder

2: Unload project

User Control - Unload Project

Unload Project

3: Edit .cproj file

User Control - Edit .cproj file

Edit .cproj file

4: Add 1 line right after the tag

Add this line:

{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
User Control - Add a line to .cproj

Add a line to .cproj

Newly added line

Newly added line

5: Reload project

Reload Project

Reload Project

It should work now. This is all I did in my project file.

Works now!

Works now!

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.

  • Delicious
  • Digg
  • Twitter
  • Facebook
  • LinkedIn
  • TechNet
  • StumbleUpon
  • NewsVine
  • Technorati Favorites
  • Slashdot
  • MSDN
  • Share/Bookmark

Related posts:

  1. Very loud sound (beep) using Windows Server 2008 and VMware
  2. Recycle application pool in Windows Server 2008
  3. Vista / Windows Server 2008 / Windows 7 activation problem: 0×8007232B – DNS name does not exist

Posted in Windows Server 2008.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Navaneetha says

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

Continuing the Discussion

  1. News Error Creating Control – Cannot Find Web Project File in Visual Studio 2008 | Web 2.0 Designer linked to this post on July 6, 2009

    [...] Link: Error Creating Control – Cannot Find Web Project File in Visual Studio 2008 [...]



Some HTML is OK

or, reply to this post via trackback.