Closed MilleBo closed 5 months ago
Thanks for your precise reporting. I reproduce the issue. I have yet to analyze what is the root cause, but MimeTypes is NOT listed as a reference by BuildAlyzer, and that is what Stryker uses. Update: this is because MimeTypes is not packaged as a library, but as a source file. This is a first for us. We need to understand how to detect this.
Thanks for your precise reporting. I reproduce the issue. I have yet to analyze what is the root cause, but MimeTypes is NOT listed as a reference by BuildAlyzer, and that is what Stryker uses. Update: this is because MimeTypes is not packaged as a library, but as a source file. This is a first for us. We need to understand how to detect this.
Thanks for looking into this and that you could reproduce it.
this is because MimeTypes is not packaged as a library, but as a source file
Interesting, think that's the first time I even heard about that type of packaging.
Thanks. I have been able to work around the issue, but this is still kludgy. It still needs tests and refinment
This turns to be harder than expected: the problem is that BuildAlyzer exhibits two problems:
I have devised a work around for problem (1), but dealing with (2) requires a redesign of the project analysis logic so it can be done in two phases. In short, It requires time.
I am currently working on a redesign of the project analysis logic, so I will incorporate needed changes there, but there are still several weeks of work before it being done.
In the short time, a possible workaround is to reuse the MimeType.cs file directly in your project (as describled in the project readme).
I remember seeing this kind of nuget package before. Is this kind of package similar to #2345?
I think the conclusion there was that this works correctly on windows for some reason, perhaps we like learn something from that.
it clears any intermediate folder during project analysis, which deletes any such files
Are you talking about buildalyzer executing a clean during project analysis? In that case multiple attempts have been made to do that, none successful. The maintainers of buildalyzer state that without a clean there's a good chance analysis fails.
remember seeing this kind of nuget package before. Is this kind of package similar to https://github.com/stryker-mutator/stryker-net/issues/2345?
It looks like a similar package, but I did not check it for confirmation?
I think the conclusion there was that this works correctly on windows for some reason, perhaps we like learn something from that.
It does not work correctly on windows, at least, not any longer, as I did reproduce on first trial. I suspect this relates to more or less subtle changes in the SDK. MSBuild default targets, to be more specific.
Are you talking about buildalyzer executing a clean during project analysis? In that case multiple attempts have been made to do that, none successful. The maintainers of buildalyzer state that without a clean there's a good chance analysis fails.
I did test removing clean
from the default targets list. It made no change at all regarding the content files, plus Stryker failed for other reasons.
At least, I learned something: Buildalyzer does not 'fail' without clean. That is, it does report success, but data is missing.
For example, there is 0 (zero) reference identified. This leads to the infamous 'System.Attributes' (or some other class) is undefined.
What I have been able to achieve is:
obj
)But I did by manually restoring files after analysis: at first, I thought this a configuration/version issue, because folder structure was still here. What I plan to do is have this specific step executed AFTER the build. That should do the trick. And open an issue on Buildalyzer, because I do not understand why some source files would not be listed.
Describe the bug I'm currently attempting to run Stryker in one of our legacy solutions that utilizes a NuGet package called MimeTypes. However, for some reason, Stryker is unable to compile it and throws compilation errors such as the following:
The name 'MimeTypes' does not exist in the current context (Source code: MimeTypes)
To verify this issue, I created a fresh project, referenced
MimeTypes
, and added a sample class that primarily utilizes MimeTypes, like this:I can build it just fine from visual studio but If I run Stryker against the solution that only contains this class (and a simple unit test that calls this class), I get the following error in my logs:
So maybe someone with more knowledge about Stryker can tell me why this NuGet package creates issues, if there is a workaround, or if it's something that needs to be fixed in Stryker to handle?
Expected behavior It should compile the project just fine.
Desktop (please complete the following information):