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

Buildalyzer warn and CS0518 system.attribute error #2685

Closed
tnoiretisa opened this issue Sep 27, 2023 · 3 comments · Fixed by #2690
Closed

Buildalyzer warn and CS0518 system.attribute error #2685

tnoiretisa opened this issue Sep 27, 2023 · 3 comments · Fixed by #2690
Labels
🐛 Bug Something isn't working

Comments

@tnoiretisa
Copy link

tnoiretisa commented Sep 27, 2023

Describe the bug
When i run dotnet stryker on my project we go warn during the build

[10:57:11 WRN] Buildalyzer could not find sourcefiles. This should not happen. Will fallback to filesystem scan. Please report an issue at github.

And error

[10:58:25 ERR] Failed to build the mutated assembly due to unrecoverable error: error CS0518: Le type prédéfini 'System.Attribute' n'est pas défini ou importé

Logs
[10:56:49 INF] Identifying project to mutate. [10:57:11 WRN] Buildalyzer could not find sourcefiles. This should not happen. Will fallback to filesystem scan. Please report an issue at github. [10:57:12 INF] Found project myproject.csproj to mutate. [10:57:12 INF] Building test project myproject.Tests.csproj (1/1) [10:58:21 INF] Total number of tests found: 157. [10:58:21 INF] Initial testrun started. [10:58:25 ERR] Failed to build the mutated assembly due to unrecoverable error: error CS0518: Le type prédéfini 'System.Attribute' n'est pas défini ou importé

Expected behavior
No warning and build sucess

Desktop (please complete the following information):

  • OS: Windows 11
  • Type of project .net framework, .net standard
  • Framework Version .net framework 4.8 / .net standard 2.0
  • Stryker Version 3.10.0

Additional context
To find the bug, i have used a standalone Buildalyzer to analyse my solutions (very big solution, >100 projects, multiple SNL on root directory etc...).
On stryker config, if solution isn't provide i have this message
Stryker could not build your project as no solution file was presented. Please pass the solution path to stryker.

Afte my fix, build logs add two additional information on skipping files

[14:16:09 DBG] Skipping auto-generated code file: myproject\obj\Debug\.NETFramework,Version=v4.8.AssemblyAttributes.cs [14:16:09 DBG] Skipping auto-generated code file: myproject\obj\Debug\myproject.AssemblyInfo.cs

I made this PR to fix this #2683

@tnoiretisa tnoiretisa added the 🐛 Bug Something isn't working label Sep 27, 2023
@tnoiretisa tnoiretisa changed the title Buildalyzer Buildalyzer warn and CS0518 system.attribute error Sep 27, 2023
@rouke-broersma
Copy link
Member

I'm not 100% sure but it appears we have a major regression in framework support where we are no longer always using the solution file, which is required for framework. Your fix appears to be the correct fix, we will look into this, thank you.

@dupdob
Copy link
Member

dupdob commented Sep 27, 2023

integration test works properly for full framework, so it may be subtler than it looks

@rouke-broersma
Copy link
Member

integration test works properly for full framework, so it may be subtler than it looks

Yep, that has me stumped.

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

Successfully merging a pull request may close this issue.

3 participants