System.Web.Compilation.BuildManager.CopyPrecompiledFile 並未將物件參考設定為物件的執行個體

使用MSBUild 的 aspnet_compiler.exe 发布网站,

过程中出现错误

复制代码
[NullReferenceException]: 並未將物件參考設定為物件的執行個體
    System.Web.Compilation.BuildManager.CopyPrecompiledFile(VirtualFile vfile,
 String destPhysicalPath)
    System.Web.Compilation.BuildManager.CopyStaticFilesRecursive(VirtualDirect
ory sourceVdir, String destPhysicalDir, Boolean topLevel)
    System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath star
tingVirtualDir, IEnumerable`1 excludedVirtualPaths)
    System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirt
ualDir, IEnumerable`1 excludedVirtualPaths)
    System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallba
ck callback, IEnumerable`1 excludedVirtualPaths)
    System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCa
llback callback, List`1 excludedVirtualPaths)
    System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCa
llback callback, List`1 excludedVirtualPaths)
    System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil
dManagerCallback callback, Boolean forceCleanBuild)
    System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuil
dManagerCallback callback)
    System.Web.Compilation.Precompiler.Main(String[] args)
复制代码

可在网站的属性页中,取消"允许更新此编译站点"

Updateable 设置为false 
Updateable='true': Allow this precompiled site to be updatable
FixedNames='true': Use fixed nameing and single page assemblies
        <AspNetCompiler
        VirtualPath='/Web'
        PhysicalPath='C:\Jenkins\jobs\KM_ERP2\workspace\Web\'
        TargetPath='C:\Jenkins\jobs\KM_ERP2\workspace\PrecompiledWeb\Web\'
        Force='false'
        Debug='false'
        Updateable='false'
        FixedNames='false' />

 

posted @   欣欣点灯  阅读(2675)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示