You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've created a Pre-Build event which runs a command to install/update webcompiler. However this fails with the message:
Target ToolRestore:
Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Exec"
dotnet tool update Excubo.WebCompiler
'C:\Users\SomeUser' is not recognized as an internal or external command,
operable program or batch file.
C:\git\projects\project-x\src\ProjectX\ProjectX.csproj(78,9): error MSB3073: The command "dotnet tool update Excubo.WebCompiler" exited with code 1.
Done executing task "Exec" -- FAILED.
Steps to Reproduce
Create a local Windows User with a special character in it: SomeUser(Company)
The project fails to run the command in the target ToolRestore.
The output is:
Target ToolRestore:
Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Exec"
dotnet tool update Excubo.WebCompiler
'C:\Users\SomeUser' is not recognized as an internal or external command,
operable program or batch file.
C:\git\projects\project-x\src\ProjectX\ProjectX.csproj(78,9): error MSB3073: The command "dotnet tool update Excubo.WebCompiler" exited with code 1.
Done executing task "Exec" -- FAILED.
Analysis
Our user folder has a special character in it: C:/Users/SomeUser(Company)
Since the tools are collected within your %APPDATA% folder it cannot find these and we're left with the message: 'C:\Users\SomeUser' is not recognized as an internal or external command, operable program or batch file. not the missing (
We've excluded the tool in question Excubo.WebCompiler as it also occurs with many other tools.
PS C:\git\projects\project-x> msbuild -version
Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
16.10.2.30804
We're using Windows 10 build 19043.1052
and have .NET 5 installed
We've found some previous encounters with this bug here: https://developercommunity.visualstudio.com/t/nuget-bug-in-vs155/160750
Do note the exact issue in this link is the repository is at a special path. Our issue is about running the prebuild task (from visual studio) where it uses something from %APPDATA% but since that path contains a special character ( it breaks.
I've stumbled upon this since i started working at another company since december 2020. Explicitly a previous version i cannot say
We recently took a change that should have prevented issues like this
Is the change already released in a newer version? If yes i'm eager to try it out as it helps us save time by reconfiguring up to 5 pc's removing the ( and ) from the user' folder
Sooo since this issue didn't occur anymore at my laptop since i changed my userfolder' name. I asked my co-workers to test it out. Some of them were still on 16.9.x
They indeed got errors trying to build this project. I told them to update and print me the msbuild versions they were using and after updating they got at version 16.10.2+857e5a733 (the latest release).
With the updates installed they successfully built the project so I think this issue can be closed and marked fixed in mentioned PR.
Thanks for pointing to the PR and the prompt result.
Issue Description
We've created a Pre-Build event which runs a command to install/update webcompiler. However this fails with the message:
Steps to Reproduce
SomeUser(Company)
dotnet new tool-manifest
Expected Behavior
The project builds without errors.
Actual Behavior
The project fails to run the command in the target
ToolRestore
.The output is:
Analysis
Our user folder has a special character in it:
C:/Users/SomeUser(Company)
Since the tools are collected within your
%APPDATA%
folder it cannot find these and we're left with the message:'C:\Users\SomeUser' is not recognized as an internal or external command, operable program or batch file.
not the missing(
We've excluded the tool in question
Excubo.WebCompiler
as it also occurs with many other tools.Example program
Made a sample project for demonstrating purposes
PreBuildEvent.zip
Versions & Configurations
We're using Windows 10 build 19043.1052
and have .NET 5 installed
Extra info
We've found some previous encounters with this bug here:
https://developercommunity.visualstudio.com/t/nuget-bug-in-vs155/160750
Do note the exact issue in this link is the repository is at a special path. Our issue is about running the prebuild task (from visual studio) where it uses something from
%APPDATA%
but since that path contains a special character(
it breaks.We've also found another previous encounter:
https://developercommunity.visualstudio.com/t/post-build-event-fails-when-parentheses-in-windows/574866
The text was updated successfully, but these errors were encountered: