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