Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions eng/tools/GenerateFiles/Directory.Build.targets.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
Condition=" '$(IsServicingBuild)' != 'true' ">${MicrosoftAspNetCoreAppRefVersion}</TargetingPackVersion>
</KnownFrameworkReference>

<PackageReference Include="Microsoft.Net.Compilers.Toolset"
Version="${MicrosoftNetCompilersToolsetVersion}"
PrivateAssets="all"
IsImplicitlyDefined="true" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why this was here before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, we'll see if something breaks. I spoke to Doug and he's going to follow up and do some research.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wtgodbe introduced this long ago (for a 3.0.0 preview) in 23a6e3e / #11818. We were reacting to a Roslyn breaking change and needed a newer toolset than Arcade (think we set $(UsingToolMicrosoftNetCompilers) at one point) or msbuild references by default. Maestro++ managed the version for a while but we stopped that at some point. @BrennanConroy and @pranavkm were among the few to change the version after we made the version manual.

I don't remember the details of the breaking change but it had something to do w/ nullability annotations and @roji did relevant work in the efcore repo. @jaredpar may know though he wasn't involved in the conversation back in the summer of 2019.


As a follow up, we should do one of

  1. change the manually-controlled toolset version and re-introduce this package reference
  2. clean up
    <MicrosoftNetCompilersToolsetVersion>3.10.0-1.final</MicrosoftNetCompilersToolsetVersion>
  3. enable $(UsingToolMicrosoftNetCompilers), meaning Arcade updates will bump the toolset version on occasion

I don't know enough about the toolset to have an opinion on which choice is best. @jaredpar

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general repositories should avoid explicitly referencing this package and instead prefer the one that just comes with arcade. The arcade version is updated at a regular cadence (roughly every other week). The idea being that this update cadence means we're regularly pushing new versions of the compiler to our partners in .NET.

This type of change where the version is pinned should be reserved for cases where a breaking change, bug, etc ... hits the repo and you need to pause the updates until we get a fix out. That appears to be what happened here except we forget to undo the pin once the bug was fixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arcade version is updated at a regular cadence (roughly every other week).

Right now, the Arcade version (see https://github.com/dotnet/arcade/blob/05634736a53ee65b0d19cf913d77d1f5d4293ebc/eng/Versions.props#L37) is far behind what the SDK uses by default (see https://github.com/dotnet/sdk/blob/ef6249b3b034b12f127b0d3a72ea428979f44413/eng/Versions.props#L120). Right now Arcade is only at v3.10.0-4.21329.37 while the SDK is at v4.0.0-2.21354.7. I suggest we simply remove our confusing $(MicrosoftNetCompilersToolsetVersion) property and leave $(UsingToolMicrosoftNetCompilers) unset i.e. my option (2). Agreed @dotnet/aspnet-build @jaredpar

</ItemGroup>

<!-- Warn if the "just-built" ASP.NET Core shared framework does not exist. -->
Expand Down
1 change: 0 additions & 1 deletion eng/tools/GenerateFiles/GenerateFiles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
MicrosoftAspNetCoreAppRuntimeVersion=$(SharedFxVersion);
MicrosoftNETCoreAppRefVersion=$(MicrosoftNETCoreAppRefVersion);
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
MicrosoftNetCompilersToolsetVersion=$(MicrosoftNetCompilersToolsetVersion);
SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers.Trim())
</_TemplateProperties>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll be able to remove this when we get a new SDK.

cc @jaredpar

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will go away in .NET 6 P7.

Copy link
Copy Markdown
Member

@DamianEdwards DamianEdwards Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredpar can you help me understand this better as the docs seem to say preview frameworks will always default to their matching preview language: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version

When your project targets a preview framework that has a corresponding preview language version, the language version used is the preview language version. You use the latest features with that preview in any environment, without affecting projects that target a released .NET Core version.

</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
app.UseDeveloperExceptionPage();
}

app.MapGet("/", (Func<string>)(() => "Hello World!"));
app.MapGet("/", () => "Hello World!");

app.Run();