dotnet / dotnet/roslyn

"dotnet build-server shutdown" warning for missing dll

Open
#74,430 8 comments 0 reactions 0 assignees View on GitHub
Area-Compilers untriaged
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

### Discussed in https://github.com/dotnet/roslyn/discussions/74429

Originally posted by **pjanotti** July 17, 2024
It seems that a recent upgrade of the runtime on GH runners started to trigger a warning and non-zero exit code for the `dotnet build-server shutdown` command executed from tests in our repo. This seems to happen with runtime `8.0.7`, but, it is also not 100% consistent. sometimes it passes in a retry - the test checks for the exit code of the command. It looks like a bug that should be fixed. Could you please confirm if that is the case?

```terminal
13:16:22 [DBG] Running: dotnet build-server shutdown
13:16:22 [DBG] ProcessId: 6839
13:16:22 [DBG] Exit Code: 1
13:16:22 [DBG] StandardOutput:
13:16:22 [DBG] Shutting down MSBuild server...
13:16:22 [DBG] Shutting down VB/C# compiler server...
13:16:22 [DBG] VB/C# compiler server failed to shut down: The shutdown command failed: Error:
13:16:22 [DBG] An assembly specified in the application dependencies manifest (VBCSCompiler.deps.json) was not found:
13:16:22 [DBG] package: 'Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler', version: '4.10.0-3.24314.14'
13:16:22 [DBG] path: 'Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll'
13:16:22 [DBG]
13:16:22 [DBG] MSBuild server shut down successfully.
13:16:22 [DBG]
```

@Kielek investigated, see [here](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/3499#issuecomment-2225336552), and
> found the `Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll` file in following locations
> ```
> C:\Program Files\dotnet\sdk\8.0.302\DotnetTools\dotnet-format
> C:\Program Files\dotnet\sdk\8.0.303\DotnetTools\dotnet-watch\8.0.303-servicing.24317.6\tools\net8.0\any
> C:\Program Files\dotnet\sdk\8.0.400-preview.0.24324.5\DotnetTools\dotnet-watch\8.0.400-preview.24323.4\tools\net8.0\any\
> ```
> and what is more important there is no such file in:
> ```
> C:\Program Files\dotnet\sdk\8.0.303\Roslyn\bincore\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll
> C:\Program Files\dotnet\sdk\8.0.400-preview.0.24324.5\Roslyn\bincore\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll
> ```
> When I manually copied the appropriate version locally to these folders, `dotnet build-server shutdown` executed from unit tests started working. I suppose that this file should be deployed there or reference should be removed.

cc @rajkumar-rangaraj

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `dotnet build-server shutdown` from the affected unit tests with runtime 8.0.7, then inspect the VBCSCompiler.deps.json reference and the SDK Roslyn/bincore deployment locations named in the report. Done means the command no longer emits the missing Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll warning or returns a non-zero exit code.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.