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

MutantControl.cs failed to build 'GC.KeepAlive' #2686

Closed
tnoiretisa opened this issue Sep 27, 2023 · 0 comments · Fixed by #2694
Closed

MutantControl.cs failed to build 'GC.KeepAlive' #2686

tnoiretisa opened this issue Sep 27, 2023 · 0 comments · Fixed by #2694
Assignees
Labels
Area: Compiling 🐛 Bug Something isn't working Priority: Medium Issues that have a workaround or but should be fixed

Comments

@tnoiretisa
Copy link

Describe the bug
After fixing #2685, we got a new error

I think it's collision with my solution root Namespace "GC" and the Garbage Collector class name

Logs

[10:55:06 INF] Initial testrun started.
[10:55:11 WRN] Stryker.NET encountered an compile error in Stryker.Core.InjectedHelpers.MutantControl.cs (at 43:12) with message: Le nom de type ou d'espace de noms 'KeepAlive' n'existe pas dans l'espace de noms 'GC' (vous manque-t-il une référence d'assembly ?) (Source code: GC.KeepAlive)
[10:55:11 WRN] Safe Mode! Stryker will try to continue by rolling back all mutations in method. This should not happen, please report this as an issue on github with the previous error message.
[10:55:11 WRN] Stryker.NET encountered an compile error in Stryker.Core.InjectedHelpers.MutantControl.cs (at 44:12) with message: Le nom de type ou d'espace de noms 'KeepAlive' n'existe pas dans l'espace de noms 'GC' (vous manque-t-il une référence d'assembly ?) (Source code: GC.KeepAlive)

Expected behavior
No build error

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
With just replace

GC.KeepAlive with System.GC.KeepAlive it's work.

But maybe it's better to remove all using on this source and specific full name on all types to avoid all potential conflict with roslyn build class ? I can do a PR to do this if you want :)

@tnoiretisa tnoiretisa added the 🐛 Bug Something isn't working label Sep 27, 2023
@dupdob dupdob self-assigned this Sep 29, 2023
@dupdob dupdob added Area: Compiling Priority: Medium Issues that have a workaround or but should be fixed labels Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Compiling 🐛 Bug Something isn't working Priority: Medium Issues that have a workaround or but should be fixed
Projects
None yet
2 participants