Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] set $(EnableSingleFileAnalyzer)=True by default (#5989)
Fixes: #5943 Context: https://github.com/dotnet/sdk/blob/c1b8e80be1f7cca767ed9f3c90a45d6830b166a0/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Analyzers.targets#L92-L96 Context: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file Context: dotnet/sdk#15239 [.NET Single File Apps][0] are a .NET deployment construct in which "all application-dependent files [are built] into a single binary." It's conceptually similar to Xamarin.Android `.apk` files, and there is some overlap in the "semantic [API incompatibilities][1]" between "normal" desktop .NET apps and Xamarin.Android/single-file apps, such as the (lack of) utility in `Assembly.Location`, which is the empty string in Xamarin.Android apps when `$(EmbedAssembliesIntoApk)`=True, which is required for "app store" distribution. For .NET 6+ app builds, enable analyzers which check for usage of these "semantically changed" APIs, by setting `$(EnableSingleFileAnalyzer)`=True. Update `Mono.Android.csproj` and `Mono.Android.Export.csproj` to also enable the single-file analyzers. After enabling this analyzer, no warnings appeared. But I do see the appropriate analyzers setup in projects now: Analyzer ~\android-toolchain\dotnet\sdk\6.0.100-preview.6.21280.2\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\ILLink.CodeFixProvider.dll IsImplicitlyDefined = true ~\android-toolchain\dotnet\sdk\6.0.100-preview.6.21280.2\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\ILLink.RoslynAnalyzer.dll IsImplicitlyDefined = true [0]: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file [1]: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file#api-incompatibility
- Loading branch information