-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
After updating our project to .NET 7, we are unable to run any of our tests via Windows PowerShell using NUnitConsole 3.16.x
Running the same tests with dotnet test
works just fine.
Scripts are run on PowerShell 5.1.19041.1237 and Windows 10 (build 19043.1288). We did try to use the newest version of PS as well but without any success.
Removing reference to Microsoft.PowerShell.SDK
from the project allows us to run tests via NUnitConsole, however we don't have any idea why is that the case.
NuGet packages in output project which may have some influence:
"Microsoft.NET.Test.Sdk" Version="17.4.1"
"Moq" Version="4.18.4"
"MSTest.TestAdapter" Version="3.0.2"
"MSTest.TestFramework" Version="3.0.2"
"NUnit3TestAdapter" Version="4.3.1"
"Microsoft.PowerShell.SDK" Version="7.3.1"
Expected behavior
Running `.\nunit3-console.exe("tests.dll")` command in PowerShell should start our tests.
Actual behavior
We get an error:
Unable to load one or more of the requested types.
Could not load file or assembly 'System.Management.Automation, Version=7.3.1.0
Environment data
Name Value
---- -----
PSVersion 5.1.19041.1237
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1237
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Metadata
Metadata
Assignees
Labels
No labels