phmonte / Buildalyzer

A utility to perform design-time builds of .NET projects without having to think too hard about it.
MIT License
589 stars 92 forks source link

Bug: Additional files not regonized #244

Open Corniel opened 5 months ago

Corniel commented 5 months ago

As mentioned in #243, I noticed that in some projects additional files (and other properties as well I guess, but that was not what I was investigating) are not recognized.

I've added created this PR, that adds a replay where the additional files are not available in the AnalyzerResult.

  1. I noticed (so far) that EventProcessor.MessageRaised(object sender, BuildMessageEventArgs e) is triggered only for v6.0.
  2. For the (existing) test that succeeds, only one TFM is detected, for this failing test, both v6.0 and v5.0 are added. The latter lacks the additional files, but is used to build anyway.
  3. If change the targets to only build .NET 5.0, or for .NET 8.0 and .NET 6.0 combined, everything works just fine.

I'll update mine findings here.

For some background, I use Buildalyzer to test Roslyn Analyzers that check for issues in .NET project files, such as MS Build project files, and RESX files. Access to the additional files is the perquisite for those tests to work. See: dotnet-project-file-analyzers