不允许循环文件引用 [英] Circular file references not allowed

查看:363
本文介绍了不允许循环文件引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS2008中构建我的解决方案时遇到问题.通常,它在环境中编译良好.有时,它会失败并显示以下信息:

I am having a problem in building my solution in VS2008. Normally, it compiles fine in the environment. Sometimes, it fails with:

/xxx_WEB/secure/CMSManagedTargetPage.aspx(1): error ASPPARSE: Circular
file references are not allowed.

我重建了,并且工作正常.

I rebuild and it works fine.

但是,现在,我正在建立CruiseControl.NET系统,并在将构建集成到CC中之前使用MSBuild测试已签出的代码.现在,每次我建立MSBuild时,我都会得到:

Now, however, I am in the middle of setting up a CruiseControl.NET system and am testing my checked out code with MSBuild before I integrate the build into CC. Now, everytime I MSBuild, I get:

"Q:\cc\xxx\checked out from svn\xxx.sln" (default target) (1) ->
(xxx_WEB target) ->
  /xxx_WEB/secure/CMSManagedTargetPage.aspx(1): error ASPPARSE: Circular
file references are not allowed.

问题是,我看不到此引用在哪里.

Problem is, I can't see where this reference is.

  • 我已经在整个解决方案中搜索了引用,并且无法找到对页面本身(CMSManagedTargetPage)的引用,而不是在页面或其代码后方或字符串内,例如:

  • I have searched for the reference across the entire solution and canf ind no references to the page itself (CMSManagedTargetPage) anywhere other than in the page or its codebehind, or within a string, eg:

C:\ dev2008 \ xxx \ IWW.xxx.ASPNET \ AspxHttpHandler.cs(82):inputFile = context.Server.MapPath(〜/secure/CMSManagedTargetPage.aspx"); C:\ dev2008 \ xxx \ IWW.xxx.ASPNET \ AspxHttpHandler.cs(83):virtualPath =〜/secure/CMSManagedTargetPage.aspx";

C:\dev2008\xxx\IWW.xxx.ASPNET\AspxHttpHandler.cs(82): inputFile = context.Server.MapPath("~/secure/CMSManagedTargetPage.aspx"); C:\dev2008\xxx\IWW.xxx.ASPNET\AspxHttpHandler.cs(83): virtualPath = "~/secure/CMSManagedTargetPage.aspx";

我的程序集引用也很好(据我所知).我的Web应用程序位于依赖项的顶部",没有任何内容引用它,因此出现故障的页面因此不能引起循环引用.当然,页面本身可能会引用同一程序集/网站中的诸如UserControl之类的内容,但是如前所述,在CMSManagedTargetPage上进行搜索不会产生任何结果,因此不会发生.

My assembly references are also fine (as far as I know). My Web Application is at the "top" of the dependencies, and nothing references it and therefore the faulting page so cannot cause a circular reference. Of course, the page itself may reference something such as a UserControl within the same assembly/web site, but as mentioned earlier, a search on CMSManagedTargetPage yielded no results so this is not happening.

更改web.config中的batch属性对MSBuild没有影响.

Changing the batch attribute in web.config had no effect on MSBuild.

我觉得很奇怪,它有时"在VS中失败,而在MSBuild中总是失败.我想念些微妙之处吗?

I find it very odd that it "sometimes" fails in VS and always fails in MSBuild. Am I missing some subtlety?

推荐答案

转发自:

http://ellisweb.net/2009/12/fixing-the-circular-file-references-are-not-allowed-error-in-asp-net/

如果您具有以下设置: /folder1/Control1.ascx>引用Control2 /folder2/Control2.ascx>引用Control3 /folder1/Control3.ascx 这意味着folder1 dll将引用folder2 dll,后者将再次引用folder1 dll,从而导致循环文件引用".

If you have the following setup: /folder1/Control1.ascx > References Control2 /folder2/Control2.ascx > References Control3 /folder1/Control3.ascx This means that the folder1 dll will reference the folder2 dll which will again reference the folder1 dll, causing a "circular file reference".

今天帮助了我.我在根目录中有一个母版页,它引用了文件夹中的母版页,而该文件夹在根目录中引用了另一个页面.改组哪个页面位于哪个文件夹中就像一个咒语一样.

This helped me out today; I had a master page in the root referencing a master page in a folder, which referenced a different page in the root. Shuffling which pages were in which folders worked like a charm.

这篇关于不允许循环文件引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆