dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.91k stars 4.01k forks source link

Microsoft.VisualStudio.LanguageServices.DevKit.csproj attempted to copy files to output directory during design time build #74801

Closed sharwell closed 3 weeks ago

sharwell commented 3 weeks ago

Version Used: ee863ed

Steps to Reproduce:

Open Roslyn.sln in Visual Studio.

Expected Behavior:

Design time build does not attempt to copy files to output (bin) directory.

Actual Behavior:

image

The caller appears to be target _CopyDevKitExtensionFiles in Microsoft.CodeAnalysis.LanguageServer.UnitTests.csproj. Design time build is broken, leading to lack of IDE features during development.

tmeschter commented 3 weeks ago

There are two issues here:

  1. Since this is an error reported through the normal MSBuild mechanisms (as opposed to an uncaught exception or a missing target or something like that) it is reasonable to expect that it will be shown in the VS Error List.
  2. Regardless of the error reporting you probably don't want _CopyDevKitExtensionFiles to run during a design-time build. The definition of the target should be updated to include Condition="'$(DesignTimeBuild)' != 'true'.