Closed bddckr closed 4 years ago
Looks like the dotnet team chose not to support Nullable for the legacy project file type. :(
https://github.com/dotnet/project-system/issues/5551
It sounds like it will work for the build, but not Intellisense.
@bddckr for now does using MSBuild.Sdk.Extras work for TargetFramework=monoandroid
?
It is not officially supported, but may be an option here.
Ah that's too bad - I didn't know about Nullable not being a thing in legacy projects! It does indeed seem to be fine for builds... Just sucks adding #nullable enable
to all our files' headers. We have to do so because we made the decision to make CS8632 an error instead of a warning (even then we're running with warnings as errors).
@jonathanpeppers I might be wrong here but that won't work for the actual app project of Xamarin.Android?
I would love to use new SDK style projects for the Xamarin app csproj if I can, but so far it looks like one basically gives up the whole IDE integration when doing so? I need my team to deploy from Visual Studio, while I'm fine with doing whatever MSBuild-compliant thing to just make the CI happy.
Yeah, MSBuild.Sdk.Extras probably won't work for the main application project--just libraries.
I'm closing this due to https://github.com/dotnet/project-system/issues/5551 then.
Thanks for the fast replies!
Steps to Reproduce
cs
files to use a nullable reference type (a C# 8.0 feature).CS8632
.I did attempt to fix this by adding
to the
csproj
, but neither that, nor just usingNullable
worked. Additionally using<NullableContextOptions>enable</NullableContextOptions>
also didn't help.XamarinAndroid-NullableReferenceTypeBug.zip
Expected Behavior
C# 8.0 should be enabled since #3807, therefore I expect nullable reference types in my own code to work without compiler errors or warnings.
Actual Behavior
Any usage of nullable reference types in a Xamarin.Android project results in
CS8632
.Version Information