Closed TAGrimm closed 5 years ago
Projects with multiple TargetFrameworks are not supported now. So I marked this as new enhancement.
If you use a way to define the attributes by command line or SonarQube.Analysis.xml you can use the plugin anyway (then there is no need to scan the project files). How to do this documented in the readme.md.
Added feature to 1.4.2 Snapshot 1, please test.
Thank you for the quick support. I'm happy that my first issue on github was done so fast :) I cannot test your changes until monday.
I saw in your code that you are looking for the target netcore, can you also add netstandard? That would be awesome!
Thank you and have a great weekend!
Today I could test your new code and the project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net452;net461</TargetFrameworks>
</PropertyGroup>
</Project>
created the following output:
DEBUG: Add 'E:\_1\23\s\source\MultiTarget\MultiTarget.csproj' to FxCop configuration.
DEBUG: Set OutputType to default (Library)
DEBUG: Set AssemblyName to default (MultiTarget)
DEBUG: Found TargetFramework (net461)
INFO: E:\_1\23\s\source\MultiTarget\bin\Debug\netstandard2.0\MultiTarget.dll
DEBUG: Finish create FxCop configuration 'E:\_1\23\s\source\UnitedGrinding.Framework.Logging.sln.20190107020206.fxcop'
When I shuffle the Targetframeworks only the last one is found. For example with <TargetFrameworks>netstandard2.0;net461;net452</TargetFrameworks>
only net452 is found.
Net stadard will be added with next checkin, I did this like that because only one executbale will be scanned and not all of them. Because they do not differ for scan with fxcop.
Hello, we are using your plugin to analyze our projects and we have started to use the new csproj format. We came across the problem that the following project is found by your plugin:
And it produces the following output:
(I know there is an issue about supporting .net core but my problem is different)
When using multi targeting and changing
TargetFramework
toTargetFrameworks
the project creates a parsing error:From scanning your code I saw in the class CSharpProjectInfo that the pattern
Pattern.compile("<TargetFramework>([\\w\\-\\ \\.\\\\]+)</TargetFramework>");
doesn't match with TargetFrameworkS.Expected behaviour: Find projects which use multiple TargetFrameworks