Use empty string as key for project properties if TargetFrameworkMonitor is not found #196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have yet another Pull Request :D But I don't know if or how you want to implement this, or if you can think of a better solution.
The thing is, with Visual Studio 2022 the TargetFrameworkMoniker is no longer generated for C++ projects even though it is told so (which kinda makes sense since there's no TargetFramework for C++ projects).
This change would use an empty string as the key for project properties if the TargetFrameworkMoniker property wasn't found so the analysis can be run for non C#/Framework projects too, especially C++ projects with Visual Studio 2022.
This would mean a change of behaviour since it will now work with projects it hasn't worked with on previous Visual Studio installations too, like installer projects. We could simply accept that or we could introduce an additional optional parameter with EventProcessor class and Build method that would only allow for an empty TargetFrameworkMoniker if specifically told so.