Skip to content

Commit a2f5d0d

Browse files
committed
Fix the VS2019 build.
xamarin-android Windows PR builds can't build, because of: error CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.0\analyzers\dotnet\cs\System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [C:\a\_work\1\s\external\Java.Interop\build-tools\jnienv-gen\jnienv-gen.csproj] Ignore the CS8032 warning/error, so that xamarin-android Windows PR builds can *build*.
1 parent 20d6bcb commit a2f5d0d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Directory.Build.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@
9191
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
9292
</PropertyGroup>
9393

94+
<!--
95+
When building on a bot w/ VS2019:
96+
97+
warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from
98+
99+
however, with `$(TreatWarningsAsErrors)`=True, this becomes an error,
100+
meaning we can't build on VS2019.
101+
102+
Ignore CS8032 so that we can build on VS2019.
103+
-->
104+
<PropertyGroup>
105+
<NoWarn>$(NoWarn);CS8032</NoWarn>
106+
</PropertyGroup>
107+
94108
<!-- The net6.0 versions of these are stricter and require overloads not available in .NET Framework, so start with just .NET Framework -->
95109
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">
96110
<AnalysisMode>AllEnabledByDefault</AnalysisMode>

0 commit comments

Comments
 (0)