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:\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.
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";
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?
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.