0x80004005 新安装的 TFS2018 Express 拒绝访问。无法执行 roslyn\csc.exe

0x80004005 Access is Denied on new install of TFS2018 Express. Can't execute roslyn\csc.exe

我已经安装了 TFS2018 Express。它似乎已完全安装。

当我尝试访问其网站组件时,出现 Win32 0x80004005 访问被拒绝错误。堆栈跟踪引用了 roslyn 子目录中的 csc.exe 程序。失败的命令提到另一个目录中的文件。

我看到其他帖子说不要在 32 位模式下 运行 TFS。安装程序没有问我,我不知道如何让它在 64 位模式下运行。

其他线程说我需要添加对该目录的读取和执行权限。哪个directory/directories?我已将它添加到整个网站目录及其子目录以及引用的文件目录中。

产品在没有足够权限的情况下自行安装并且不告诉我们需要哪些权限,这似乎非常愚蠢。

错误消息告诉我哪个命令失败了。

[Win32Exception (0x80004005): Access is denied]

[ExternalException (0x80004005): Cannot execute a program.  The command being executed was:

"d:\Program Files\Microsoft Team Foundation Server 2018\Application Tier\Web Services\bin\roslyn\csc.exe" /shared /keepalive:"10" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\tfs\af7cc54hjudj.cmdline"

只是为了测试,在战斗了一段时间后,我将 roslyn 目录和 TFS(和子)目录的完全控制权交给了提到 cmdline 文件的域用户。错误消息没有变化。

我把上面的命令放到命令行里运行就可以了。我收到此错误消息:

error CS2011: Error opening response file 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\tfs\af7cc54hjudj.cmdline'
warning CS2008: No source files specified
error CS1562: Outputs without source must have the /out option specified.

有什么想法吗?

请参阅 https://developercommunity.visualstudio.com/content/problem/165639/0x80004005-access-is-denied-on-new-install-of-tfs2.html# 以获得对我有用的答案。

关键要素是该程序是通过 iso 安装程序安装的,它显然导致网站 运行 处于 32 位模式,而需要 64 位模式。

这导致网站重新编译为 64 位模式:

Files under C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files are created by ASP.NET compiler. It is very strange that error message mentions

C:\Windows\Microsoft.NET\Framework\v4.0.30319 instead of

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

since TFS must be running in 64-bit Application Pool. Could you make sure that "Microsoft Team Foundation Server Application Pool" and "Microsoft Team Foundation Server Message Queue Application Pool" application pools are configured to run in 64 bit processes?

To do this you can do the following:

1) Open IIS Manager (inetmgr.exe)

2) Select Application Pools page

3) Select "Microsoft Team Foundation Server Application Pool" click on "Advanced Settings..." link on the right pane.

4) Make sure that Enable 32-bit Applications is set to False.

5) Repeat steps 3 and 4 for the "Microsoft Team Foundation Server Message Queue Application Pool"

Once you verified that application pools are configured to run in 64 bit processes, open Sites page in the IIS manager and find out ID of the Team Foundation Server site (second column). Usually it is 1 or 2.

After that, execute the following from the elevated command prompt:

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -errorstack -m /LM/W3SVC/1/root/tfs

Replace bold 1 with ID of your Team Foundation Server site.

Does it report any errors?

在我的例子中,应用程序池的 32 位设置是正确的,aspnet_compiler.exe 命令导致网站切换到 64 位模式。之后就好了。