Skip to content

Commit db4600c

Browse files
committed
net70 reference assemblies
1 parent b0109bc commit db4600c

10 files changed

Lines changed: 3449 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
- name: Pack Net60
3434
run: dotnet pack --no-build -p:IncludeSymbols=false -p:RepositoryCommit=${GITHUB_SHA} -p:PackageVersion="${{ github.event.inputs.version }}" -c Release Basic.Reference.Assemblies.Net60/Basic.Reference.Assemblies.Net60.csproj -o .
3535

36+
- name: Pack Net70
37+
run: dotnet pack --no-build -p:IncludeSymbols=false -p:RepositoryCommit=${GITHUB_SHA} -p:PackageVersion="${{ github.event.inputs.version }}" -c Release Basic.Reference.Assemblies.Net70/Basic.Reference.Assemblies.Net70.csproj -o .
38+
3639
- name: Pack NetCoreApp31
3740
run: dotnet pack --no-build -p:IncludeSymbols=false -p:RepositoryCommit=${GITHUB_SHA} -p:PackageVersion="${{ github.event.inputs.version }}" -c Release Basic.Reference.Assemblies.NetCoreApp31/Basic.Reference.Assemblies.NetCoreApp31.csproj -o .
3841

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<IsPackable>true</IsPackable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.NETCore.App.Ref" Version="6.0.9" IncludeAssets="none" PrivateAssets="all" GeneratePathProperty="true" />
10+
</ItemGroup>
11+
12+
<Import Project="Generated.targets" />
13+
</Project>
14+

Basic.Reference.Assemblies.Net70/Generated.cs

Lines changed: 1018 additions & 0 deletions
Large diffs are not rendered by default.

Basic.Reference.Assemblies.Net70/Generated.targets

Lines changed: 656 additions & 0 deletions
Large diffs are not rendered by default.

Basic.Reference.Assemblies.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic.Reference.Assemblies.
2626
EndProject
2727
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic.Reference.Assemblies.NetStandard13", "Basic.Reference.Assemblies.NetStandard13\Basic.Reference.Assemblies.NetStandard13.csproj", "{DF0A6565-DAB8-4646-AEB4-AF322BE8CBC5}"
2828
EndProject
29+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic.Reference.Assemblies.Net70", "Basic.Reference.Assemblies.Net70\Basic.Reference.Assemblies.Net70.csproj", "{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}"
30+
EndProject
2931
Global
3032
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3133
Debug|Any CPU = Debug|Any CPU
@@ -144,6 +146,18 @@ Global
144146
{DF0A6565-DAB8-4646-AEB4-AF322BE8CBC5}.Release|x64.Build.0 = Release|Any CPU
145147
{DF0A6565-DAB8-4646-AEB4-AF322BE8CBC5}.Release|x86.ActiveCfg = Release|Any CPU
146148
{DF0A6565-DAB8-4646-AEB4-AF322BE8CBC5}.Release|x86.Build.0 = Release|Any CPU
149+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
150+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
151+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Debug|x64.ActiveCfg = Debug|Any CPU
152+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Debug|x64.Build.0 = Debug|Any CPU
153+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Debug|x86.ActiveCfg = Debug|Any CPU
154+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Debug|x86.Build.0 = Debug|Any CPU
155+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
156+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Release|Any CPU.Build.0 = Release|Any CPU
157+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Release|x64.ActiveCfg = Release|Any CPU
158+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Release|x64.Build.0 = Release|Any CPU
159+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Release|x86.ActiveCfg = Release|Any CPU
160+
{24CCB309-D324-4AD6-A1D4-7E9CFD82A7FD}.Release|x86.Build.0 = Release|Any CPU
147161
EndGlobalSection
148162
GlobalSection(SolutionProperties) = preSolution
149163
HideSolutionNode = FALSE

Basic.Reference.Assemblies/Basic.Reference.Assemblies.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<Import Project="Generated.Net50.targets" />
99
<Import Project="Generated.Net60.targets" />
10+
<Import Project="Generated.Net70.targets" />
1011
<Import Project="Generated.NetCoreApp31.targets" />
1112
<Import Project="Generated.NetStandard13.targets" />
1213
<Import Project="Generated.NetStandard20.targets" />

Basic.Reference.Assemblies/Generated.Net70.cs

Lines changed: 1018 additions & 0 deletions
Large diffs are not rendered by default.

Basic.Reference.Assemblies/Generated.Net70.targets

Lines changed: 656 additions & 0 deletions
Large diffs are not rendered by default.

Docs/Updating.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Updating Reference Assembly Versions
2+
===
3+
4+
# Creating a new Target Framework
5+
To create a new Target Framework assembly do the following. Note: this is written for creating `net7.0` but can be applied to any target framework by using the approriate moniker:
6+
7+
First need to find the version of the Microsoft.NETCore.App.Ref to use. Navigate to the [NuPkg link](https://www.nuget.org/packages/Microsoft.NETCore.App.Ref) and find the latest version. In this case we'll be using 7.0.0-rc.1.22426.10.
8+
9+
Create the directory `Basic.Reference.Assemblies.Net70` and add a project file with the following format:
10+
11+
```xml
12+
<Project Sdk="Microsoft.NET.Sdk">
13+
14+
<PropertyGroup>
15+
<TargetFramework>netstandard2.0</TargetFramework>
16+
<IsPackable>true</IsPackable>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="Microsoft.NETCore.App.Ref" Version="7.0.0-rc.1.22426.10" IncludeAssets="none" PrivateAssets="all" GeneratePathProperty="true" />
21+
</ItemGroup>
22+
23+
<Import Project="Generated.targets" />
24+
</Project>
25+
```
26+
27+
Run `dotnet restore` to ensure the NuPkg is downloaded to the machine. Update the `Generate.ps1` file to have an entry for the new target framework
28+
29+
**Note**: the version on disk can differ from what is put in the csproj file. If `Generate.ps1` fails check to see if the version on disk was slightly different and just use that.
30+
31+
```ps1
32+
# Net70
33+
$map = Get-Content "Net70" 'microsoft.netcore.app.ref\7.0.0-rc.2.22469.6\ref\net7.0'
34+
$targetDir = Join-Path $PSScriptRoot "..\Basic.Reference.Assemblies.Net70"
35+
$map.CodeContent | Out-File (Join-Path $targetDir "Generated.cs") -Encoding Utf8
36+
$map.TargetsContent | Out-File (Join-Path $targetDir "Generated.targets") -Encoding Utf8
37+
$map.CodeContent | Out-File (Join-Path $combinedDir "Generated.Net70.cs") -Encoding Utf8
38+
$map.TargetsContent | Out-File (Join-Path $combinedDir "Generated.Net70.targets") -Encoding Utf8
39+
```
40+
41+
Open the Basic.Reference.Assemblies.sln file in Visual Studio. Use `Add Existing Project` to include `Basic.Reference.Assemblies.Net70.csproj` in the solution. Then open `Basic.Reference.Assemblies.csproj` and ensure the new Generated targets are imported
42+
43+
```xml
44+
<Import Project="Generated.Net70.targets" />
45+
```
46+
47+
Open `publish.yml` and add an entry for the target framework
48+
49+
```yml
50+
- name: Pack Net70
51+
run: dotnet pack --no-build -p:IncludeSymbols=false -p:RepositoryCommit=${GITHUB_SHA} -p:PackageVersion="${{ github.event.inputs.version }}" -c Release Basic.Reference.Assemblies.Net70/Basic.Reference.Assemblies.Net70.csproj -o .
52+
```
53+
54+
# Upgrading existing Target Framework
55+
To upgrade an existing target framework do the following:
56+
57+
1. Navigate to https://www.nuget.org/packages/Microsoft.NETCore.App.Ref and find the latest version for the target framework. For say `net6.0` that will be the latest version begining with `6.0`.
58+
2. Move to that version in the appropriate project file. For say `net6.0` that wil be Basic.Reference.Assemblies.Net60.csproj
59+
3. Move to that version in Generate.ps1 for the target framework
60+
4. Run `Scripts\Generate.ps1`
61+

Scripts/Generate.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ $map.TargetsContent | Out-File (Join-Path $targetDir "Generated.targets") -Encod
201201
$map.CodeContent | Out-File (Join-Path $combinedDir "Generated.Net60.cs") -Encoding Utf8
202202
$map.TargetsContent | Out-File (Join-Path $combinedDir "Generated.Net60.targets") -Encoding Utf8
203203

204+
# Net70
205+
$map = Get-Content "Net70" 'microsoft.netcore.app.ref\7.0.0-rc.2.22469.6\ref\net7.0'
206+
$targetDir = Join-Path $PSScriptRoot "..\Basic.Reference.Assemblies.Net70"
207+
$map.CodeContent | Out-File (Join-Path $targetDir "Generated.cs") -Encoding Utf8
208+
$map.TargetsContent | Out-File (Join-Path $targetDir "Generated.targets") -Encoding Utf8
209+
$map.CodeContent | Out-File (Join-Path $combinedDir "Generated.Net70.cs") -Encoding Utf8
210+
$map.TargetsContent | Out-File (Join-Path $combinedDir "Generated.Net70.targets") -Encoding Utf8
211+
204212
# NetStandardl.3
205213
$map = Get-ResourceContent "NetStandard13" "Resources\netstandard1.3"
206214
$targetDir = Join-Path $PSScriptRoot "..\Basic.Reference.Assemblies.NetStandard13"

0 commit comments

Comments
 (0)