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
I noticed some odd behavior when trying to pass an argument with escaped parentheses to some external programs.
Passing escaped parentheses to some programs no longer works correctly in PowerShell 7.3.0:
e.g.: dotnet test """$(where.exe dotnet)"""
results in error: C:\Program Files\dotnet\dotnet.exe(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
This only happens with PowerShell 7.3.0. It does not happen in 7.2.7 or 5.1.
I don't think this is a bug in dotnet.exe (7.0.100) since I have also tried this with nunit3-console (3.16.0):
When using nunit3-console the error is
System.ArgumentException : Illegal characters in path.
--ArgumentException
Illegal characters in path.
at System.IO.LongPathHelper.Normalize(String path, UInt32 maxPathLength, Boolean checkInvalidCharacters, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at NUnit.Engine.TestPackage..ctor(String filePath)
at NUnit.Engine.TestPackage..ctor(IList`1 testFiles)
at NUnit.ConsoleRunner.ConsoleRunner.MakeTestPackage(ConsoleOptions options)
at NUnit.ConsoleRunner.ConsoleRunner.Execute()
at NUnit.ConsoleRunner.Program.Main(String[] args)
When using PowerShell 7.2.7 or 5.1, I get the correct error: System.BadImageFormatException : Format of the executable (.exe) or library (.dll) is invalid.
I have also tried alternate means of escaping the character: dotnet test $('"' + "$(where.exe dotnet)" + '"') dotnet test "`"$(where.exe dotnet)`""
All with the same result.
Note: I'm only using $(where.exe dotnet) as an arbitrary example. I get the same behavior with any assembly I try to test.
Expected behavior
Dotnet.exe returns something like:Microsoft (R) Test Execution Command Line Tool Version 17.4.0 (x64)Copyright (c) Microsoft Corporation. All rights reserved.Starting test execution, please wait...A total of 1 test files matched the specified pattern.No test is available in C:\Program Files\dotnet\dotnet.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Actual behavior
C:\Program Files\dotnet\dotnet.exe(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Error details
Get-Error does not return anything in this case.
Environment data
Name Value
---------
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.0
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Steps to reproduce
I noticed some odd behavior when trying to pass an argument with escaped parentheses to some external programs.
Passing escaped parentheses to some programs no longer works correctly in PowerShell 7.3.0:
e.g.:
dotnet test """$(where.exe dotnet)"""
results in error:
C:\Program Files\dotnet\dotnet.exe(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
This only happens with PowerShell 7.3.0. It does not happen in 7.2.7 or 5.1.
I don't think this is a bug in dotnet.exe (7.0.100) since I have also tried this with nunit3-console (3.16.0):
When using nunit3-console the error is
When using PowerShell 7.2.7 or 5.1, I get the correct error:
System.BadImageFormatException : Format of the executable (.exe) or library (.dll) is invalid.
I have also tried alternate means of escaping the character:
dotnet test $('"' + "$(where.exe dotnet)" + '"')
dotnet test "`"$(where.exe dotnet)`""
All with the same result.
Note: I'm only using
$(where.exe dotnet)
as an arbitrary example. I get the same behavior with any assembly I try to test.Expected behavior
Actual behavior
C:\Program Files\dotnet\dotnet.exe(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Error details
Get-Error does not return anything in this case.
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: