-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot execute .NET 8 tests that require the Desktop or ASP.NET runtime #1383
Comments
The error occurs when the Here is a repro |
@OsirisTerje Any news on this? |
@ilCosmico No, we don't have anyone working here at the moment. |
@mlessmann Although some other people have referenced this with respect to the NETCORE console runner, it's not clear from your report that you are using it, as opposed to the standard console runner. Can you clarify what package you have installed? It would also help to see the command line you are using to run your tests. |
Executing a .NET 8 test assembly that references types from WinForms, WPF, or ASP.NET results in the following (or similar) exception:
Could not load file or assembly 'System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e89'. The system cannot find the file specified.
The reason is that the nunit-agent only references the Microsoft.NETCore.App runtime in its runtimeconfig.json. Therefore a workaround is to manually add the missing runtimes (Microsoft.WindowsDesktop.App and/or Microsoft.AspNetCore.App) to the runtimeconfig.json.
As far as I know adding the WindowsDesktop runtime will lead to the agent no longer working on Linux. Ideally we could load the necessary runtimes dynamically depending on what dependencies the test assembly has, though I have no idea if that is even possible. The Microsoft documentation does not sound promising.
The text was updated successfully, but these errors were encountered: