Circular file references not allowed

后端 未结 15 1887
没有蜡笔的小新
没有蜡笔的小新 2020-12-18 19:10

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/CMSManagedT         


        
相关标签:
15条回答
  • 2020-12-18 19:30

    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.

    0 讨论(0)
  • 2020-12-18 19:30

    I ran into your post when I ran into the same problem. There are probably a million solutions to a Circular reference problem, but mine was a direct result of Master Pages.

    I accidentally created a page using a nested masterpage, outside the nested folder. Example:

    Master1.Master
    Page.aspx
    (Folder1) 
    Master2.Master
    

    While Page.aspx was referencing Master2.Master as its masterpage, It would build normally, and error when I "Publish".

    0 讨论(0)
  • 2020-12-18 19:33

    I had this same error during a major development overhaul. In my particular case this was because I was using a "JUNK" folder where I was dragging and dropping unused or renamed files. My junk folder was being compiled and a file I recently deleted was causing this problem.

    I fixed this by excluding the individual file in my junk folder.

    0 讨论(0)
  • 2020-12-18 19:33

    Same issue on some code I inherited.

    My issue was I had a file in the app_data Folder, but it had a namespace of MyControls in it. I ended up moving that file out of the app_data folder and created a new folder "my controls".

    0 讨论(0)
  • 2020-12-18 19:38

    For me it was registering the aspx page on the master page as well.

    For example (in the master page):

    <%@ Register Assembly="MyPage" Namespace="MyPage" TagPrefix="MyPage" %>
    ...
    <asp:ContentPlaceHolder id="MyPage" runat="server"></asp:ContentPlaceHolder>
    

    And then in the aspx page:

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" 
        CodeFile="MyPage.aspx.cs" Inherits="MyPage" Title="Untitled Page" %>
    <asp:Content ID="SomeContent" ContentPlaceHolderID="MyPage" Runat="Server">
    

    Removing the Register fixed it.

    0 讨论(0)
  • 2020-12-18 19:42

    I also ran into this problem, was able to get a successful Publish from within Visual Studio by selectin the "Use fixed naming and single page assemblies." For some reason that seems to avoid the compilier thinking there is a circular reference.

    0 讨论(0)
提交回复
热议问题