Skip to content

Default web templates to net5.0 #20748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
19 changes: 12 additions & 7 deletions eng/Workarounds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,22 @@
<PackageReference Include="Internal.AspNetCore.BuildTasks" PrivateAssets="All" Version="$(InternalAspNetCoreBuildTasksPackageVersion)" IsImplicitlyDefined="true" />
</ItemGroup>

<PropertyGroup>
<KnownAppHostPackOrFrameworkReferenceTfm>$(DefaultNetCoreTargetFramework)</KnownAppHostPackOrFrameworkReferenceTfm>
<KnownAppHostPackOrFrameworkReferenceTfm Condition="'$(KnownAppHostPackOrFrameworkReferenceTfm)' == 'net5.0'">netcoreapp5.0</KnownAppHostPackOrFrameworkReferenceTfm>
</PropertyGroup>

<ItemGroup>
<!-- Workaround when there is no vNext SDK available, copy known apphost/framework reference info from 3.0 -->
<!-- Workaround when there is no vNext SDK available, copy known apphost/framework reference info from 3.1 -->
<KnownAppHostPack
Include="@(KnownAppHostPack->WithMetadataValue('TargetFramework', 'netcoreapp3.0'))"
TargetFramework="$(DefaultNetCoreTargetFramework)"
Condition="@(KnownAppHostPack->Count()) != '0' AND !(@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(DefaultNetCoreTargetFramework)')))"
Include="@(KnownAppHostPack->WithMetadataValue('TargetFramework', 'netcoreapp3.1'))"
TargetFramework="$(KnownAppHostPackOrFrameworkReferenceTfm)"
Condition="@(KnownAppHostPack->Count()) != '0' AND !(@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(KnownAppHostPackOrFrameworkReferenceTfm)')))"
/>
<KnownFrameworkReference
Include="@(KnownFrameworkReference->WithMetadataValue('TargetFramework', 'netcoreapp3.0'))"
TargetFramework="$(DefaultNetCoreTargetFramework)"
Condition="@(KnownFrameworkReference->Count()) != '0' AND !(@(KnownFrameworkReference->AnyHaveMetadataValue('TargetFramework', '$(DefaultNetCoreTargetFramework)')))"
Include="@(KnownFrameworkReference->WithMetadataValue('TargetFramework', 'netcoreapp3.1'))"
TargetFramework="$(KnownAppHostPackOrFrameworkReferenceTfm)"
Condition="@(KnownFrameworkReference->Count()) != '0' AND !(@(KnownFrameworkReference->AnyHaveMetadataValue('TargetFramework', '$(KnownAppHostPackOrFrameworkReferenceTfm)')))"
/>
</ItemGroup>

Expand Down
6 changes: 4 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"sdk": {
"version": "5.0.100-preview.5.20251.2"
"version": "5.0.100-preview.5.20251.2",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
"dotnet": "5.0.100-preview.5.20251.2",
Expand All @@ -15,7 +17,7 @@
"Git": "2.22.0",
"jdk": "11.0.3",
"vs": {
"version": "16.3",
"version": "16.5",
"components": [
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"HostIdentifier": {
"type": "bind",
Expand Down
3 changes: 3 additions & 0 deletions src/ProjectTemplates/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<!-- TODO: Remove this when alls parts of aspnetcore switched to the net5.0 TFM. -->
<DefaultNetCoreTargetFramework>net5.0</DefaultNetCoreTargetFramework>

<!-- The .csproj files in this folder do not actually produce .dll's. They are only present to produce .nupkgs and enable Visual Studio support -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
<HasReferenceAssembly>false</HasReferenceAssembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"defaultValue": "netcoreapp5.0"
"defaultValue": "net5.0"
},
"ExcludeLaunchSettings": {
"type": "parameter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"defaultValue": "netcoreapp5.0"
"defaultValue": "net5.0"
},
"HostIdentifier": {
"type": "bind",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"copyrightYear": {
"type": "generated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"HostIdentifier": {
"type": "bind",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"HostIdentifier": {
"type": "bind",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp5.0",
"description": "Target netcoreapp5.0"
"choice": "net5.0",
"description": "Target net5.0"
}
],
"replaces": "netcoreapp5.0",
"defaultValue": "netcoreapp5.0"
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"HostIdentifier": {
"type": "bind",
Expand Down
2 changes: 1 addition & 1 deletion src/ProjectTemplates/build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@ECHO OFF
SET RepoRoot=%~dp0..\..
%RepoRoot%\build.cmd -projects %~dp0*\*.*proj "/p:EnforceE2ETestPrerequisites=true" %*
%RepoRoot%\build.cmd -projects %~dp0*\*.*proj -ForceCoreMsbuild "/p:EnforceE2ETestPrerequisites=true" %*