microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
192 stars 6 forks source link

[BUG] Initial build task not properly quoting path resulting in MSB1008 #1077

Closed ChrisK91 closed 2 weeks ago

ChrisK91 commented 3 weeks ago

Describe the Issue

I'm working on a new MAUI project. When running the default build action for Windows, I occasionally get a MSB1008 error, which seems to be due to an improperly quoted path. I've included the output below, where --property:CustomAfterMicrosoftCSharpTargets is actually split on the space-character and another parameter is inserted inbetween.

I'm not sure if this is actually an issue with the VSCode-Extension or dotnet build itself.

Steps To Reproduce

  1. Create new MAUI project, use a user directory with a space (e.g. "C:\Users\FIRSTNAME LASTNAME\")
  2. Restart VSCode
  3. Try to build the project and observe build output
    • Executing task: dotnet build -t:Build -p:Configuration=Debug -f net8.0-windows10.0.19041.0 -p:WindowsPackageType=None -p:CustomAfterMicrosoftCSharpTargets="c:\Users\FIRSTNAME LASTNAME\.vscode\extensions\ms-dotnettools.dotnet-maui-0.10.61-win32-x64\dist\resources\Custom.After.Microsoft.CSharp.targets" -p:_DeletePriConfigXml=True D:\Daten\Dokumente\GitHub\XXXX\XXXX\XXXX.csproj
    • MSBuild-Version 17.9.8+b34f75857 für .NET
    • MSBUILD : error MSB1008: Es darf nur ein Projekt angegeben werden. (Only one project must be specified)
    • Vollständige Befehlszeile: „E:\SDKs\dotnet\8\sdk\8.0.204\MSBuild.dll -maxcpucount -verbosity:m -target:Restore --property:Configuration=Debug --property:WindowsPackageType=None --property:CustomAfterMicrosoftCSharpTargets=c:\Users\FIRSTNAME --property:_DeletePriConfigXml=True LASTNAME\.vscode\extensions\ms-dotnettools.dotnet-maui-0.10.61-win32-x64\dist\resources\Custom.After.Microsoft.CSharp.targets D:\Daten\Dokumente\GitHub\XXXX\XXXX\XXXX.csproj -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,E:\SDKs\dotnet\8\sdk\8.0.204\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,E:\SDKs\dotnet\8\sdk\8.0.204\dotnet.dll“ (complete command line)

Expected Behavior

Build should succeed without errors

Environment Information

Laufzeitumgebung: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: E:\SDKs\dotnet\8\sdk\8.0.204\

Installierte .NET-Workloads: [maui] Installationsquelle: SDK 8.0.200 Manifestversion: 8.0.7/8.0.100 Manifestpfad: E:\SDKs\dotnet\8\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.7\WorkloadManifest.json Installationstyp: FileBased

Host: Version: 8.0.4 Architecture: x64 Commit: 2d7eea2529

.NET SDKs installed: 8.0.204 [E:\SDKs\dotnet\8\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 8.0.4 [E:\SDKs\dotnet\8\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.4 [E:\SDKs\dotnet\8\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.4 [E:\SDKs\dotnet\8\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: DOTNET_ROOT [E:\SDKs\dotnet\8]

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download


| VS Bug <a href="https://devdiv.visualstudio.com/DevDiv/_queries/edit/2046942">2046942</a>
ChrisK91 commented 3 weeks ago

To work around this issue it is possible to move the extension folder by setting a environment variable as outlined here: https://github.com/microsoft/vscode/issues/17691

emaf commented 2 weeks ago

Duplicate of https://github.com/microsoft/vscode-dotnettools/issues/745