Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

visual studio 2008 - Circular file references not allowed

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.

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:ccxxxchecked out from svnxxx.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.

  • 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:dev2008xxxIWW.xxx.ASPNETAspxHttpHandler.cs(82): inputFile = context.Server.MapPath("~/secure/CMSManagedTargetPage.aspx"); C:dev2008xxxIWW.xxx.ASPNETAspxHttpHandler.cs(83): virtualPath = "~/secure/CMSManagedTargetPage.aspx";

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.

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Reposted from:

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...