Skip to content
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

NUnit tests not being discovered for project on .Net 8 #772

Open
jrbye opened this issue Nov 30, 2023 · 3 comments
Open

NUnit tests not being discovered for project on .Net 8 #772

jrbye opened this issue Nov 30, 2023 · 3 comments
Assignees
Labels
area-project-cps bug Something isn't working
Milestone

Comments

@jrbye
Copy link

jrbye commented Nov 30, 2023

Describe the Issue

I have a solution containing 6 test projects using SpecFlow and NUnit. Everything is using .Net 8. When I build I get the following logs once per Project:

2023-11-30 08:49:12.722 [error] (c:\Users\USER\source\repos\Automation\APIAutomation\APIAutomation.csproj): SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.Sdk". Exception: "System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath) at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory) at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IList1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable1& errors, IEnumerable1& warnings)""
2023-11-30 08:49:12.789 [error] Failed to load project 'c:\Users\USER\source\repos\Automation\APIAutomation\APIAutomation.csproj'. One or more errors occurred. (SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.Sdk". Exception: "System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath)
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IList1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable1& errors, IEnumerable1& warnings)"" c:\Users\USER\source\repos\Automation\APIAutomation\APIAutomation.csproj)

The tests are not detected. I have deleted the workspaceStorage folder and restarted VSCode and the folder was recreated.

Steps To Reproduce

1.) Update a project to .Net 8.0
2.) Open project in VSCode and build it

Expected Behavior

The tests should snow up in the tests pane.

Environment Information

Latest VS Code
Latest C# Dev Kit Extension (Even tried pre-release version)
Windows 11

@jrbye jrbye added the bug Something isn't working label Nov 30, 2023
@microsoft-issue-labeler microsoft-issue-labeler bot added the area-project Project load, Solution Explorer label Nov 30, 2023
@kvenkatrajan kvenkatrajan added area-project-cps and removed area-project Project load, Solution Explorer labels Nov 30, 2023
Copy link

github-actions bot commented Apr 3, 2024

This issue has been marked as stale after 14 days of inactivity. @[ @ @], could you please take a look?

@Michael-Eng
Copy link
Member

@jrbye going through our older bugs. I think we've fixed an issue in this area when we added .NET8 support. Can you confirm if this is working for you now with the latest C# Dev Kit?

@Michael-Eng Michael-Eng self-assigned this Apr 26, 2024
@Michael-Eng Michael-Eng added this to the June2024 milestone Apr 26, 2024
@jrbye
Copy link
Author

jrbye commented Apr 26, 2024

@jrbye going through our older bugs. I think we've fixed an issue in this area when we added .NET8 support. Can you confirm if this is working for you now with the latest C# Dev Kit?

@Michael-Eng I am still seeing errors in VS Code

2024-04-26 16:48:26.668 [error] Failed to load project 'c:\Users\user\source\repos\solutionFolder\projectFolder\projectName.csproj'. One or more errors occurred. (SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.Sdk". Exception: "System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath) at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory) at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IList1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable1& errors, IEnumerable1& warnings)"" c:\Users\user\source\repos\solutionFolder\projectFolder\projectName.csproj)
2024-04-26 16:48:26.692 [info] Project system initialization finished. 0 project(s) are loaded, and 7 failed to load.`

I am seeing this for every project. The tests are working is Visual Studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-project-cps bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants