* Update to C#9

* - add one C#9 feature

* - toolset

* - NS20 only

* - check msbuild version
This commit is contained in:
Shane Neuville 2021-04-05 08:34:03 -05:00 коммит произвёл GitHub
Родитель e0b7d31cc6
Коммит 70b23f45f0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
14 изменённых файлов: 18 добавлений и 14 удалений

Просмотреть файл

@ -44,4 +44,8 @@
<Target Name="GitInfo" />
<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="$(MSBuildThisFileDirectory)eng\Environment.Build.props" />
<Import Condition="'$(SampleProject)' != 'True' and '$(CI)' == 'true'" Project="$(MSBuildThisFileDirectory)eng\SourceLink.Build.props" />
</Project>
<ItemGroup Condition="'$(MSBuildVersion)' != '' AND '$(MSBuildVersion)' &lt; '16.7.0' ">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.9.0" PrivateAssets="all" />
</ItemGroup>
</Project>

Просмотреть файл

@ -28,7 +28,7 @@
</PropertyGroup>
<PropertyGroup>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<!-- This is used by the libraries -->

Просмотреть файл

@ -19,7 +19,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -20,7 +20,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -17,7 +17,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -16,7 +16,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -15,7 +15,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -15,7 +15,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -14,7 +14,7 @@
This is needed for non SDK style project so the IDE will pick the correct LangVersion.
Once this is an SDK style project it will pick this up from the Directory.Build.Props file correctly
-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

Просмотреть файл

@ -27,7 +27,7 @@ namespace Microsoft.Maui
handler.SetVirtualView(view);
if (!(handler.NativeView is UIView result))
if (handler.NativeView is not UIView result)
{
throw new InvalidOperationException($"Unable to convert {view} to {typeof(UIView)}");
}

Просмотреть файл

@ -13,7 +13,7 @@
<MDocDocumentationDirectory>$(MSBuildThisFileDirectory)..\docs\en</MDocDocumentationDirectory>
<DebugType>portable</DebugType>
<Configurations>Debug;Release</Configurations>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
<NoWarn>$(NoWarn);CA1416;CS8305</NoWarn>

Просмотреть файл

@ -15,7 +15,7 @@
<MDocDocumentationDirectory>$(MSBuildThisFileDirectory)..\docs\en</MDocDocumentationDirectory>
<DebugType>portable</DebugType>
<Configurations>Debug;Release</Configurations>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugSymbols>true</DebugSymbols>

Просмотреть файл

@ -5,7 +5,7 @@
<RootNamespace>Microsoft.Maui.Resizetizer</RootNamespace>
<AssemblyName>Microsoft.Maui.Resizetizer</AssemblyName>
<!--<Nullable>enable</Nullable>-->
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
<IncludeBuildOutput>False</IncludeBuildOutput>
<NoWarn>$(NoWarn);NU5100;NU5128;</NoWarn>
<IsTrimmable>false</IsTrimmable>