5

这是我得到的错误:

错误 101 无法加载类型“控件”。/Test.vbproj/x.ascx 1 1 WebDeployProject

这是上周作为项目一部分的遗留文件,但其中一位开发人员将其从项目中删除。我必须手动删除文件才能构建 WDP。有没有办法告诉 WDP 忽略不属于项目的文件或查看这些文件不属于项目并删除它们?

4

4 回答 4

6

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.

于 2009-01-20T19:14:05.670 回答
3

它可能与网络项目的类型有关。

如果它是一个网站,那么编译器将尝试编译文件夹中的每个文件。但是,如果它是一个 Web 应用程序项目,那么它只会编译您专门添加为项目一部分的那些。

于 2009-01-31T20:19:32.240 回答
1

如果您最近从项目中删除/删除了一个文件,那么您需要转到项目>“显示所有文件”,所有删除的文件都将出现在您的解决方案资源管理器中。您可以删除文件 /x.ascx 并重建 WDP。

于 2010-04-21T08:28:06.630 回答
0

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.

于 2010-04-21T18:29:03.247 回答