IIS 7.5中托管的站点预编译问题

时间:2012-11-21 12:29:53

标签: .net compilation iis-7.5

我正在尝试预编译IIS 7.5中托管的.NET站点。此站点是在.net中构建的,也是指包含文件。对于包含文件,我们创建了单独的.inc文件,这些文件称为from.cs文件。现在,当我们尝试通过aspnet_compiler编译网站时,我们收到以下错误消息。有什么帮助吗?

错误ASPRUNTIME:Failed to map the path '/Includes/usercontext.inc'.

[InvalidOperationException]: Failed to map the path '/Includes/usercontext.inc'.
   at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull)
   at System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath)
   at System.Web.Hosting.MapPathBasedVirtualFile.EnsureFileInfoObtained()
   at System.Web.Hosting.MapPathBasedVirtualFile.Open()
   at System.Web.Hosting.VirtualPathProvider.OpenFile(String virtualPath)
   at System.Web.UI.DependencyParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.DependencyParser.ProcessServerInclude(Match match)
   at System.Web.UI.DependencyParser.ParseString(String text)
   at System.Web.UI.DependencyParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.DependencyParser.GetVirtualPathDependencies()
   at System.Web.Compilation.TemplateControlBuildProvider.GetBuildResultVirtualPathDependencies()
   at System.Web.Compilation.WebDirectoryBatchCompiler.GetBuildResultDependencies()
   at System.Web.Compilation.WebDirectoryBatchCompiler.Process()
   at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors)
   at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir)
   at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir)
   at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback)
   at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback)
   at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback)
   at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild)
   at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback)
   at System.Web.Compilation.Precompiler.Main(String[] args)

1 个答案:

答案 0 :(得分:0)

早些时候我试图用

进行编译
aspnet_compiler.exe -v<virtual path> -p<physical path> -errorstack >><filename>

但是当我使用以下命令更改它时,此问题得到解决。但我不知道背后的原因是什么。

aspnet_compiler.exe -m <metabase path> -errorstack >><filename>