Skip to content

Commit 8615f76

Browse files
authored
do not enable nullable on netstandard2.0 (#3299)
1 parent 1626945 commit 8615f76

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

template_feed/Microsoft.DotNet.Common.ProjectTemplates.6.0/content/ClassLibrary-CSharp/Company.ClassLibrary1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
66
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.ClassLibrary1</RootNamespace>
77
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion>
8-
<Nullable Condition="'$(Nullable)' == 'true'">enable</Nullable>
8+
<Nullable Condition="('$(Nullable)' == 'true') AND ('$(Framework)' != 'netstandard2.0')">enable</Nullable>
99
</PropertyGroup>
1010

1111
</Project>

test/dotnet-new3.UnitTests/CommonTemplatesTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public CommonTemplatesTests(SharedHomeDirectory fixture, ITestOutputHelper log)
6363
[InlineData("Class Library", "classlib", "C#", "netcoreapp2.1")]
6464
[InlineData("Class Library", "classlib", "F#", "netcoreapp2.1")]
6565
[InlineData("Class Library", "classlib", "VB", "netcoreapp2.1")]
66+
[InlineData("Class Library", "classlib", "C#", "netstandard2.0")]
67+
[InlineData("Class Library", "classlib", "VB", "netstandard2.0")]
68+
[InlineData("Class Library", "classlib", "F#", "netstandard2.0")]
6669

6770
[InlineData("Simple Console Application", "app")]
6871
[InlineData("Simple Console Application", "app", "C#")]
@@ -167,6 +170,9 @@ Determining projects to restore\.\.\.
167170
[InlineData("Class Library", "classlib", "C#", "netcoreapp2.1")]
168171
[InlineData("Class Library", "classlib", "F#", "netcoreapp2.1")]
169172
[InlineData("Class Library", "classlib", "VB", "netcoreapp2.1")]
173+
[InlineData("Class Library", "classlib", "C#", "netstandard2.0")]
174+
[InlineData("Class Library", "classlib", "VB", "netstandard2.0")]
175+
[InlineData("Class Library", "classlib", "F#", "netstandard2.0")]
170176

171177
[InlineData("Simple Console Application", "app")]
172178
[InlineData("Simple Console Application", "app", "C#")]
@@ -306,7 +312,7 @@ public void SetPropertiesByDefault(string propertyName, string? propertyValue, s
306312
}
307313

308314
[Theory]
309-
//unset nullable
315+
//unset nullable
310316
[InlineData("Nullable", null, "--nullable", "false", "Simple Console Application", "app", null, null)]
311317
[InlineData("Nullable", null, "--nullable", "false", "Class Library", "classlib", null, null)]
312318

0 commit comments

Comments
 (0)