views:

522

answers:

4

This is the error I get:

Error 101 Could not load type 'control'. /Test.vbproj/x.ascx 1 1 WebDeployProject

This is a left over file that was part of the project last week, but one of the developers deleted it from the project. I have to manually delete the file in order to get the WDP to build. Is there a way to tell the WDP to ignore the files that are not part of the project or to see that these files are not part of the project and delete them?

+4  A: 

You'll need to use your source control tools to find and remove local files that aren't under source control.

For instance, if you're using TFS, do the following:

  • Open Source Control Explorer (View -> Other Windows -> Source Control Explorer)
  • Right-click on the path in TFS that corresponds to your local working copy and select Compare
  • Use your TFS path as Source Path and your local working copy as Target Path
  • Under View Options, select "Show items that exist only in target path"

You've now got a list of all the files that exist in your local working copy but aren't in source control. For each file, either delete your local copy or add it to source control.

Joseph Anderson
+3  A: 

It could have something do to with the type of web project is it.

If it's a web site, then the compiler will attempt to compile every file in the folder. However, if it's a Web Application Project, then it will only compile those that you've specifically added as part of the project.

AaronS
this definitely is how it should be. unfortunately it isn't. for me it is failing on the .aspx pages that are copied over to sources even if they're not included in the project. for instance i had 'Copy of MasterPage.master' and that file was being pre-compiled!! grr
Simon_Weaver
+1  A: 

If you have recently deleted/removed a file from your project then you need go to Project > "Show all files" and all removed files will apear in your solution explorer. You can delete the file, /x.ascx and rebuild your WDP.

Neville Chinan
A: 

It has nothing to do with the type of Web project: http://amiraryani.wordpress.com/2008/11/06/web-deployment-project-aspparse-could-not-load-type/.

A Web Site itself considers files under its root directory as part of the site.

A Web Application Project itself allows you to customize build actions, etc. on a per-file basis.

A Web Deployment Project, however, will try to include files under the root directory (a la a Web Site), even if the WDP is associated with a WAP. That's why it doesn't matter which kind of Web project it is.

EDIT: To clarify, it would matter what type of Web project you are using if you were trying to Build, Debug, or Publish that project itself instead of using a WDP.

apollodude217