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

Stryker looking in .Net6.0 build folder for .Net8.0 project #2886

Open
SDanehy opened this issue Mar 18, 2024 · 1 comment
Open

Stryker looking in .Net6.0 build folder for .Net8.0 project #2886

SDanehy opened this issue Mar 18, 2024 · 1 comment
Labels
🐛 Bug Something isn't working

Comments

@SDanehy
Copy link

SDanehy commented Mar 18, 2024

Describe the bug
When running Stryker locally it is looking for the AssemblyInfo.cs file in the .net6.0 folder but the project has a target framework of .net8.0

Logs
dotnet stryker -p PROJECT_NAME.csproj --target-framework 'net8.0'

_____ _ _ _ _ ______ _______  
/ | | | | | \ | | |
| (
| |
_ __ _ | | _____ _ __ | | | |
| |  
_
| | '| | | | |/ / _ \ '| | . ` | | | |  
) | || | | || | < / | | |\ | | | |  
|
_/ _
|| _, ||____|| ()|| _|____| ||  
/ |  
|
/  

Version: 4.0.1

[13:07:52 INF] Analysis starting.
[13:08:03 INF] Analysis complete.
[13:08:03 ERR] An error occurred during the mutation test run
System.IO.DirectoryNotFoundException: Could not find a part of the path C:\source...\obj\Release\net6.0\WorkerExtensions.AssemblyInfo.cs'.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize) at System.IO.File.ReadAllText(String path, Encoding encoding) at System.IO.Abstractions.FileWrapper.ReadAllText(String path) at Stryker.Core.Initialisation.CsharpProjectComponentsBuilder.FindProjectFilesUsingBuildalyzer(IAnalyzerResult analyzerResult, StrykerOptions options) in /_/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs:line 92 at Stryker.Core.Initialisation.CsharpProjectComponentsBuilder.Build() in /_/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs:line 39 at Stryker.Core.Initialisation.InputFileResolver.BuildSourceProjectInfo(StrykerOptions options, IAnalyzerResult analyzerResult, IEnumerable1 analyzerResults) in //src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs:line 227
at Stryker.Core.Initialisation.InputFileResolver.ResolveSourceProjectInfos(StrykerOptions options) in /
/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs:line 68
at Stryker.Core.Initialisation.InitialisationProcess.GetMutableProjectsInfo(StrykerOptions options) in //src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs:line 58
at Stryker.Core.Initialisation.ProjectOrchestrator.MutateProjects(StrykerOptions options, IReporter reporters, ITestRunner runner)+MoveNext() in /
/src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs:line 50
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator) in /_/src/Stryker.Core/Stryker.Core/StrykerRunner.cs:line 63 [13:08:03 INF] Time Elapsed 00:00:10.8702594 Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path 'X:\source\Commerce\commerce-search-service\Commerce.Search\src\Commerce.Search.AzureFunctions\obj\Release\net6.0\WorkerExtensions.AssemblyInfo.cs'. at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.File.ReadAllText(String path, Encoding encoding)
at System.IO.Abstractions.FileWrapper.ReadAllText(String path)
at Stryker.Core.Initialisation.CsharpProjectComponentsBuilder.FindProjectFilesUsingBuildalyzer(IAnalyzerResult analyzerResult, StrykerOptions options) in //src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs:line 92
at Stryker.Core.Initialisation.CsharpProjectComponentsBuilder.Build() in /
/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs:line 39
at Stryker.Core.Initialisation.InputFileResolver.BuildSourceProjectInfo(StrykerOptions options, IAnalyzerResult analyzerResult, IEnumerable1 analyzerResults) in /_/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs:line 227 at Stryker.Core.Initialisation.InputFileResolver.ResolveSourceProjectInfos(StrykerOptions options) in /_/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs:line 68 at Stryker.Core.Initialisation.InitialisationProcess.GetMutableProjectsInfo(StrykerOptions options) in /_/src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs:line 58 at Stryker.Core.Initialisation.ProjectOrchestrator.MutateProjects(StrykerOptions options, IReporter reporters, ITestRunner runner)+MoveNext() in /_/src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs:line 50 at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Stryker.Core.StrykerRunner.RunMutationTest(IStrykerInputs inputs, ILoggerFactory loggerFactory, IProjectOrchestrator projectOrchestrator) in //src/Stryker.Core/Stryker.Core/StrykerRunner.cs:line 63
at Stryker.CLI.StrykerCli.RunStryker(IStrykerInputs inputs) in /
/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 102
at Stryker.CLI.StrykerCli.<>c__DisplayClass11_0.b__0() in //src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 74
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass143_0.b__0(CancellationToken )
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Stryker.CLI.StrykerCli.Run(String[] args) in /
/src/Stryker.CLI/Stryker.CLI/StrykerCLI.cs:line 80
at Stryker.CLI.Program.Main(String[] args) in /
/src/Stryker.CLI/Stryker.CLI/Program.cs:line 14
Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: Windows
  • Type of project .Net8.0
  • Stryker Version 4.0.1

Additional context
I found this stack overflow article with the same issue but it does not have a solution yet:

https://stackoverflow.com/questions/78015604/stryker-cant-find-workerextensions-assemblyinfo-cs

@SDanehy SDanehy added the 🐛 Bug Something isn't working label Mar 18, 2024
@dupdob
Copy link
Member

dupdob commented Mar 23, 2024

thanks for reporting this. Could you please share the project file (.csproj)?
Are you certain this file is not explicitly referred in the project (it happens sometimes)?
Are you certain there is no configuration that targets net6.0?

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

No branches or pull requests

2 participants