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

.NET 8 stryker issue using primary constructor #2817

Open
mjthompson2023 opened this issue Jan 3, 2024 · 1 comment
Open

.NET 8 stryker issue using primary constructor #2817

mjthompson2023 opened this issue Jan 3, 2024 · 1 comment
Labels
🐛 Bug Something isn't working

Comments

@mjthompson2023
Copy link

mjthompson2023 commented Jan 3, 2024

Describe the bug
I have upgraded to .NET 8 and am having an issue in using a primary constructor when running in an Azure pipeline. It is fine when I run the stryker test on my laptop.

Logs

2024-01-03T16:58:05.7526405Z Generated source code may be missing.
2024-01-03T16:58:05.7527462Z System.InvalidOperationException
2024-01-03T16:58:05.7527850Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7528322Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7528851Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7530195Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7530672Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7534101Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)
2024-01-03T16:58:05.7534381Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.GetSourceGenerators(IAnalyzerResult analyzerResult, ILogger logger)
2024-01-03T16:58:05.7548411Z [16:58:05 WRN] Analyzer/Generator assembly /opt/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/analyzers/dotnet/cs/Microsoft.Interop.JavaScript.JSImportGenerator.dll could not be loaded. 
2024-01-03T16:58:05.7548998Z Generated source code may be missing.
2024-01-03T16:58:05.7549658Z System.InvalidOperationException
2024-01-03T16:58:05.7550096Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7550840Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7551389Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7552337Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7552802Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7553192Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)
2024-01-03T16:58:05.7634849Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.GetSourceGenerators(IAnalyzerResult analyzerResult, ILogger logger)
2024-01-03T16:58:05.7635244Z [16:58:05 WRN] Analyzer/Generator assembly /opt/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/analyzers/dotnet/cs/Microsoft.Interop.LibraryImportGenerator.dll could not be loaded. 
2024-01-03T16:58:05.7635530Z Generated source code may be missing.
2024-01-03T16:58:05.7635668Z System.InvalidOperationException
2024-01-03T16:58:05.7635908Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7636213Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7636532Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7636851Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7637155Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7637390Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)
2024-01-03T16:58:05.7637653Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.GetSourceGenerators(IAnalyzerResult analyzerResult, ILogger logger)
2024-01-03T16:58:05.7637998Z [16:58:05 WRN] Analyzer/Generator assembly /opt/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.dll could not be loaded. 
2024-01-03T16:58:05.7638244Z Generated source code may be missing.
2024-01-03T16:58:05.7638396Z System.InvalidOperationException
2024-01-03T16:58:05.7638619Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7638937Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7639239Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7639808Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7640093Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7640343Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)
2024-01-03T16:58:05.7640603Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.GetSourceGenerators(IAnalyzerResult analyzerResult, ILogger logger)
2024-01-03T16:58:05.7659116Z [16:58:05 WRN] Analyzer/Generator assembly /opt/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/analyzers/dotnet/cs/System.Text.RegularExpressions.Generator.dll could not be loaded. 
2024-01-03T16:58:05.7659406Z Generated source code may be missing.
2024-01-03T16:58:05.7659589Z System.InvalidOperationException
2024-01-03T16:58:05.7659815Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7660136Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7660440Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7660773Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7661065Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7661315Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)
2024-01-03T16:58:05.7661579Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.GetSourceGenerators(IAnalyzerResult analyzerResult, ILogger logger)
2024-01-03T16:58:05.7679590Z [16:58:05 WRN] Analyzer/Generator assembly /opt/hostedtoolcache/dotnet/packs/Microsoft.AspNetCore.App.Ref/8.0.0/analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll could not be loaded. 
2024-01-03T16:58:05.7679882Z Generated source code may be missing.
2024-01-03T16:58:05.7680037Z System.InvalidOperationException
2024-01-03T16:58:05.7680264Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7680578Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7680899Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7681226Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7681537Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7681771Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)
2024-01-03T16:58:05.7682045Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.GetSourceGenerators(IAnalyzerResult analyzerResult, ILogger logger)
2024-01-03T16:58:05.7694138Z [16:58:05 WRN] Analyzer/Generator assembly /opt/hostedtoolcache/dotnet/packs/Microsoft.AspNetCore.App.Ref/8.0.0/analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Options.SourceGeneration.dll could not be loaded. 
2024-01-03T16:58:05.7694455Z Generated source code may be missing.
2024-01-03T16:58:05.7694771Z System.InvalidOperationException
2024-01-03T16:58:05.7695015Z    at Stryker.Core.Initialisation.Buildalyzer.IAnalyzerResultExtensions.<>c.<GetSourceGenerators>b__6_0(Object sender, AnalyzerLoadFailureEventArgs e)
2024-01-03T16:58:05.7695317Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.AddExtensions(Builder builder, String language, Func`2 shouldInclude)
2024-01-03T16:58:05.7695635Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.CreateLanguageSpecificExtensions(String language, Extensions`1 extensions)
2024-01-03T16:58:05.7695955Z    at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary`2& location, TKey key, Func`3 valueFactory, TArg factoryArgument)
2024-01-03T16:58:05.7696335Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetExtensions(String language)
2024-01-03T16:58:05.7696570Z    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators(String language)

Expected behavior
The stryker test should pass

Desktop (please complete the following information):

  • OS: ubuntu-latest
  • Type of project [core]
  • Framework Version [.NET 8]
  • Stryker Version [3.13.0]

Additional context

@mjthompson2023 mjthompson2023 added the 🐛 Bug Something isn't working label Jan 3, 2024
@rouke-broersma
Copy link
Member

rouke-broersma commented Jan 5, 2024

Can you confirm that the source generator assemblies actually exist on your hosted agent at /opt/hostedtoolcache/dotnet/packs/Microsoft.AspNetCore.App.Ref/8.0.0/analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Options.SourceGeneration.dll

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