“ /”应用程序访问中的服务器错误被拒绝

时间:2019-02-26 20:22:17

标签: asp.net iis model-view-controller

  

这是问题I asker earlier的继续,但是当我解决后,我立即又陷入困境

我的Asp.net Mvc应用程序未加载,我在IIS中运行它以浏览到它,相反,我得到了以下信息

enter image description here

堆栈跟踪

  

[Win32Exception(0x80004005):访问被拒绝]

     

[ExternalException(0x80004005):无法执行程序。命令   被执行是   “ C:\ Users \ JoeCampbell \ source \ repos \ webapi \ bin \ roslyn \ csc.exe” /共享   / keepalive:“ 10” / noconfig / fullpaths   @“ C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \临时ASP.NET   Files \ root \ f66da336 \ 3058efba \ 3w2ezdih.cmdline“。]
  System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle   userToken,字符串cmd,字符串currentDir,TempFileCollection   tempFiles,字符串和输出名称,字符串和错误名称,字符串trueCmdLine)   +1767 System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle   userToken,字符串cmd,字符串currentDir,TempFileCollection   tempFiles,字符串和输出名称,字符串和错误名称,字符串trueCmdLine)   +208 System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr userToken,String cmd,String currentDir,TempFileCollection   tempFiles,String&outputName,String&errorName)+125
  Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.Compile(CompilerParameters   选项,字符串编译器,FullPath,字符串参数,字符串&   outputFile,Int32&nativeReturnValue)+413
  Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters   选项,字符串[]文件名)+857
  Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters   选项,字符串[]文件名)+185
  System.Web.Compilation.AssemblyBuilder.Compile()+1869
  System.Web.Compilation.BuildProvidersCompiler.PerformBuild()+306
  System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(布尔   isPrecompiledApp)+330
  System.Web.Compilation.BuildManager.CompileGlobalAsax()+49
  System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()+327

     

[HttpException(0x80004005):无法执行程序。命令   被执行是   “ C:\ Users \ JoeCampbell \ source \ repos \ webapi \ bin \ roslyn \ csc.exe” /共享   / keepalive:“ 10” / noconfig / fullpaths   @“ C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \临时ASP.NET   Files \ root \ f66da336 \ 3058efba \ 3w2ezdih.cmdline“。]
  System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()   +73 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()+603   System.Web.Compilation.BuildManager.CallAppInitializeMethod()+36
  System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager   appManager,IApplicationHost,appHost,IConfigMapPathFactory   configMapPathFactory,HostingEnvironmentParametershostingParameters,   PolicyLevel policyLevel,异常appDomainCreationException)+831

     

[HttpException(0x80004005):无法执行程序。命令   被执行是   “ C:\ Users \ JoeCampbell \ source \ repos \ webapi \ bin \ roslyn \ csc.exe” /共享   / keepalive:“ 10” / noconfig / fullpaths   @“ C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \临时ASP.NET   Files \ root \ f66da336 \ 3058efba \ 3w2ezdih.cmdline“。]
  System.Web.HttpRuntime.FirstRequestInit(HttpContext上下文)+523
  System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文)   +107 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest   wr,HttpContext上下文)+688

我尝试过的事情

  • 在Windows功能中启用Windows身份验证
  • 在“属性”窗口中将Windows身份验证属性更改为“启用”

1 个答案:

答案 0 :(得分:0)

我通过转到堆栈跟踪中列出的文件夹并授予webapi.localhost.net的完全权限来解决此问题,但是对于您来说,这将成为您的应用程序池标识。

对我来说是

  

“ C:\ Users \ JoeCampbell \ source \ repos \ webapi \ bin \ roslyn \ csc.exe”

然后我右键单击文件夹>属性>安全>

在“组或用户名:”中单击您的应用程序池标识

点击修改,然后授予完全控制权限

点击确定

enter image description here