-
Notifications
You must be signed in to change notification settings - Fork 467
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
.NET 10: PlatformCompatibilityAnalyzer not working #7525
Comments
Yes the code that you shared looks faulty. Just wanted to add that a component should never parse and interpret the Why? Because with the eventually coming TFM aliasing feature, this analyzer will stop working: <PropertyGroup>
<TargetFrameworks>vs17.12;vs17.13</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>10.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<RoslynAnalyzerVersion Condition="'$(TargetFramework)' == 'vs17.12'">4.12</RoslynAnalyzerVersion>
<RoslynAnalyzerVersion Condition="'$(TargetFramework)' == 'vs17.13'">4.13</RoslynAnalyzerVersion>
</PropertyGroup> |
cc @jeffhandley @dotnet/dotnet-analyzers -- this is going to be a blocking issue for .NET 10.0. We should get it fixed ASAP. I think the fix should be to pass in the parsed values for roslyn-analyzers/src/Utilities/Compiler/Options/MSBuildPropertyOptionNames.cs Lines 15 to 24 in 5ed3367
|
Changes: dotnet/sdk@5b9d9d4...a93a592 % git diff --shortstat 5b9d9d4677...a93a592ce9 2336 files changed, 57809 insertions(+), 28665 deletions(-) Changes: dotnet/runtime@226c034...4b02c51 % git diff --shortstat 226c0347b9...4b02c51f71 6343 files changed, 214693 insertions(+), 177501 deletions(-) Changes: dotnet/emsdk@8e660ff...953fd74 % git diff --shortstat 8e660ff41e...953fd74cd2 44 files changed, 844 insertions(+), 521 deletions(-) Changes: dotnet/cecil@9c94433...9e8bd52 % git diff --shortstat 9c9443396f8...9e8bd520939 20 files changed, 317 insertions(+), 205 deletions(-) Changes: a8cd27e...4b20432 % git diff --shortstat a8cd27e...4b20432 1522 files changed, 302553 insertions(+), 40811 deletions(-) Context: dotnet/msbuild#11237 Context: dotnet/roslyn-analyzers#7525 Context: dotnet/maui#27040 Bump to: * .NET SDK 10.0.100-alpha.1.25056.1 * .NET Runtime 10.0.0-alpha.1.25056.1 * .NET Android 35.0.24 Note that the `Xamarin.Android-PR (MAUI Tests MAUI Integration)` lane will fail with: > Workload installation failed: Could not find workload 'microsoft-net-runtime-android-net9' > extended by workload 'android' in manifest 'microsoft.net.sdk.android' until we get dotnet/maui on .NET 10 (see e.g. dotnet/maui#27040). Regressions discovered: * MSBuild: dotnet/msbuild#11237 * Roslyn analyzers: dotnet/roslyn-analyzers#7525 I temporarily disabled tests that hit these issues, with a code comment to restore them in the future. Other changes: * Add the `dotnet10` NuGet feeds. * `$(DotNetTargetFramework)` is `net10.0` * Update project templates to say `net10.0-android`. * Update `WorkloadManifest.json` to support .NET 10 and able to build `net9.0-android` projects. * Replace the contents of `AutoImports.props`, so we shouldn't need to modify this file each year. * Various tests should target `net9.0-android` for the "previous" .NET Android version and `net10.0-android` for the current. * `workload-dependencies.csproj` needs `$(RollForward)=Major` to allow it to run on a .NET 10 runtime. Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Jonathan Peppers <[email protected]> Co-authored-by: Jonathan Pobst <[email protected]>
Analyzer
Diagnostic ID: CA1416:
Validate platform compatibility
Analyzer source
Describe the bug
For Android, we have an API such as:
Using the API with
SupportedOSPlatformVersion=21.0
does not result in aCA1416
warning.We first noticed this here, getting the Android workload on a .NET 10 SDK:
In the following integration test:
Steps To Reproduce
dotnet new android
button.AccessibilityTraversalAfter
Here is a
.binlog
if that is helpful: supportedosplatformversion.zipExpected behavior
Using the API with
SupportedOSPlatformVersion=21.0
results in aCA1416
warning.Actual behavior
Using the API with
SupportedOSPlatformVersion=21.0
does not result in aCA1416
warning.Additional context
I'm guessing the code here would not work as expected for
TargetFramework=net10.0
, as it has 1 more digit:roslyn-analyzers/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/InteropServices/PlatformCompatibilityAnalyzer.cs
Lines 284 to 289 in 5ed3367
The text was updated successfully, but these errors were encountered: