Msbuild 发布时获取无法加载类型错误

Msbuild 发布时获取无法加载类型错误,msbuild,cruisecontrol.net,aspnet-compiler,Msbuild,Cruisecontrol.net,Aspnet Compiler,尝试使用aspnet\u编译器发布后出现以下错误 errorASPPARSE: Circular file references are not allowed. errorASPPARSE: Unknown server tag 'uc2:FAQ'. errorASPPARSE: Could not load type 'CompoundControls.BBar'. errorASPPARSE: Could not load type 'CompoundControls.PPIndicato

尝试使用aspnet\u编译器发布后出现以下错误

errorASPPARSE: Circular file references are not allowed.
errorASPPARSE: Unknown server tag 'uc2:FAQ'.
errorASPPARSE: Could not load type 'CompoundControls.BBar'.
errorASPPARSE: Could not load type 'CompoundControls.PPIndicator'.
errorASPPARSE: Unknown server tag 'm:Calendar'.
errorASPPARSE: Could not load type 'SharedUserControls.VCDetails'.
errorASPPARSE: Could not load type 'SharedUserControls.VPDetails'.
errorASPPARSE: Could not load type 'SharedUserControls.VPrDetails'.
errorASPPARSE: Could not load type '.PopupPaymentCardCCVHelp'.     

任何关于如何解决这些问题的想法

有几个原因可以解释为什么循环文件引用是不允许的错误

如果不查看项目的结构或代码,就很难确定确切的原因

然而,如果我要做一个有根据的猜测,我会这样做:

  • 查看下一个错误:
    未知服务器标记“uc2:FAQ”。
    ,它似乎无法编译该用户控件
  • 这种用户控制也可能是这里争论的焦点。其余部分是
    UserControl
    未编译的结果
  • 如果是这样,则检查用户控件中是否有对母版页/任何其他页面的引用(类似于ascx文件中的
同样,当您无意中进入这种情况时,用户控制会出现一个不太明显的循环引用问题(通过):

PageA.aspx->uc1.ascx->PageB.aspx(批处理)->uc1.ascx->PageA.aspx(批处理)

如果这是可能的原因,请尝试在配置中设置:

<configuration>
  <system.web>
    <!-- should prevent errorASPPARSE: Circular file references are not allowed -->
    <compilation batch="false" />
  </system.web>
</configuration>


希望这能有所帮助。

这可能与CruiseControl.net无关:请从命令行调用CCNet正在执行的同一MSBuild命令,好吗?当详细度设置为DEBUG时,您可以在构建日志中看到它试图调用的内容。