Просмотр исходного кода

Remove the cast from the empty web project template (#33393)

* Remove the cast

* Add language version preview

* Remove implicit Microsoft.Net.Compilers.TooSet dependency
David Fowler 4 лет назад
Родитель
Сommit
5f8fce6221

+ 0 - 4
eng/tools/GenerateFiles/Directory.Build.targets.in

@@ -54,10 +54,6 @@
           Condition=" '$(IsServicingBuild)' != 'true' ">${MicrosoftAspNetCoreAppRefVersion}</TargetingPackVersion>
     </KnownFrameworkReference>
 
-    <PackageReference Include="Microsoft.Net.Compilers.Toolset"
-      Version="${MicrosoftNetCompilersToolsetVersion}"
-      PrivateAssets="all"
-      IsImplicitlyDefined="true" />
   </ItemGroup>
 
   <!-- Warn if the "just-built" ASP.NET Core shared framework does not exist. -->

+ 0 - 1
eng/tools/GenerateFiles/GenerateFiles.csproj

@@ -17,7 +17,6 @@
         MicrosoftAspNetCoreAppRuntimeVersion=$(SharedFxVersion);
         MicrosoftNETCoreAppRefVersion=$(MicrosoftNETCoreAppRefVersion);
         MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
-        MicrosoftNetCompilersToolsetVersion=$(MicrosoftNetCompilersToolsetVersion);
         SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers.Trim())
       </_TemplateProperties>
     </PropertyGroup>

+ 1 - 0
src/ProjectTemplates/Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in

@@ -4,6 +4,7 @@
     <TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
     <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
     <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
+    <LangVersion>preview</LangVersion>
   </PropertyGroup>
 
 </Project>

+ 1 - 1
src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs

@@ -10,6 +10,6 @@ if (app.Environment.IsDevelopment())
     app.UseDeveloperExceptionPage();
 }
 
-app.MapGet("/", (Func<string>)(() => "Hello World!"));
+app.MapGet("/", () => "Hello World!");
 
 app.Run();