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