Skip to content

Commit c4f91f1

Browse files
authored
Update to .NET 8 (#416)
* Update to .NET 8 * Update graph cli core library
1 parent e440763 commit c4f91f1

File tree

5 files changed

+116
-79
lines changed

5 files changed

+116
-79
lines changed

.azure-pipelines/release-cli.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ stages:
7070
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'))
7171
steps:
7272
- task: UseDotNet@2
73-
displayName: 'Use .NET 7'
73+
displayName: 'Use .NET 8'
7474
inputs:
75-
version: 7.x
75+
version: 8.x
7676

7777
# Restore NuGet packages (enables cache by default)
7878
- template: templates/nuget-packages.yaml
@@ -114,10 +114,10 @@ stages:
114114
# maxParallel: 2
115115
steps:
116116
- task: UseDotNet@2
117-
displayName: 'Use .NET 7'
117+
displayName: 'Use .NET 8'
118118
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'))
119119
inputs:
120-
version: 7.x
120+
version: 8.x
121121

122122
- ${{ if ne(parameters.simulate, 'true') }}:
123123
- template: templates/nuget-packages.yaml
@@ -179,9 +179,9 @@ stages:
179179
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'))
180180
steps:
181181
- task: UseDotNet@2
182-
displayName: 'Use .NET 7'
182+
displayName: 'Use .NET 8'
183183
inputs:
184-
version: 7.x
184+
version: 8.x
185185

186186
# Restore NuGet packages (enables cache by default)
187187
- template: templates/nuget-packages.yaml
@@ -410,10 +410,10 @@ stages:
410410

411411
# Nuget tool doesn't work with multi-stage builds
412412
- task: UseDotNet@2
413-
displayName: 'Use .NET 7'
413+
displayName: 'Use .NET 8'
414414
condition: and(false, succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
415415
inputs:
416-
version: 7.x
416+
version: 8.x
417417

418418
- ${{ if ne(parameters.simulate, 'true') }}:
419419
- template: templates/nuget-packages.yaml
@@ -448,7 +448,7 @@ stages:
448448
script: |
449449
$path = '$(ARTIFACTS_PATH)'
450450
if ('$(IS_NUGET)'.ToLower() -eq 'true' -and ('${{ parameters.simulate }}'.ToLower() -ne 'true')) {
451-
$path = './src/obj/$(buildConfiguration)/net7.0'
451+
$path = './src/obj/$(buildConfiguration)/net8.0'
452452
}
453453
Write-Verbose "Checking if $path has files"
454454
$hasArtifacts = Test-Path $path/* -PathType Leaf

.vscode/launch.json

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "coreclr",
1010
"request": "launch",
1111
"preLaunchTask": "build",
12-
"program": "${workspaceFolder}/src/bin/Debug/net7.0/mgc.dll",
12+
"program": "${workspaceFolder}/src/bin/Debug/net8.0/mgc.dll",
1313
"args": ["-h"],
1414
"cwd": "${workspaceFolder}/src",
1515
"envFile": "${workspaceFolder}/src/.env",
@@ -21,7 +21,7 @@
2121
"type": "coreclr",
2222
"request": "launch",
2323
"preLaunchTask": "build",
24-
"program": "${workspaceFolder}/src/bin/Debug/net7.0/mgc.dll",
24+
"program": "${workspaceFolder}/src/bin/Debug/net8.0/mgc.dll",
2525
"args": ["login"],
2626
"cwd": "${workspaceFolder}/src",
2727
"envFile": "${workspaceFolder}/src/.env",
@@ -33,7 +33,7 @@
3333
"type": "coreclr",
3434
"request": "launch",
3535
"preLaunchTask": "build",
36-
"program": "${workspaceFolder}/src/bin/Debug/net7.0/mgc.dll",
36+
"program": "${workspaceFolder}/src/bin/Debug/net8.0/mgc.dll",
3737
"args": ["me", "get", "--output", "TABLE"],
3838
"cwd": "${workspaceFolder}/src",
3939
"envFile": "${workspaceFolder}/src/.env",
@@ -45,17 +45,53 @@
4545
"type": "coreclr",
4646
"request": "launch",
4747
"preLaunchTask": "build",
48-
"program": "${workspaceFolder}/src/bin/Debug/net6.0/mgc.dll",
48+
"program": "${workspaceFolder}/src/bin/Debug/net8.0/mgc.dll",
4949
"args": ["users", "item", "patch", "--user-id", "admin@M365x258755.OnMicrosoft.com", "--body", "{\"officeLocation\": \"NewLocation\"}", "--debug"],
5050
"cwd": "${workspaceFolder}/src",
5151
"envFile": "${workspaceFolder}/src/.env",
5252
"console": "internalConsole",
5353
"stopAtEntry": false
5454
},
55+
{
56+
"name": "sites get",
57+
"type": "coreclr",
58+
"request": "launch",
59+
// "preLaunchTask": "build",
60+
"justMyCode": false,
61+
"symbolOptions": {
62+
"searchPaths": [],
63+
"searchMicrosoftSymbolServer": false,
64+
"searchNuGetOrgSymbolServer": true
65+
},
66+
"program": "${workspaceFolder}/src/bin/Debug/net8.0/mgc.dll",
67+
"args": ["sites", "list", "--debug"],
68+
"cwd": "${workspaceFolder}/src",
69+
"envFile": "${workspaceFolder}/src/.env",
70+
"console": "internalConsole",
71+
"stopAtEntry": false
72+
},
73+
{
74+
"name": "identity get",
75+
"type": "coreclr",
76+
"request": "launch",
77+
// "preLaunchTask": "build",
78+
"justMyCode": false,
79+
// "symbolOptions": {
80+
// "searchPaths": [],
81+
// "searchMicrosoftSymbolServer": false,
82+
// "searchNuGetOrgSymbolServer": true
83+
// },
84+
"program": "${workspaceFolder}/src/bin/Debug/net8.0/mgc.dll",
85+
"args": ["identity", "get", "--debug"],
86+
"cwd": "${workspaceFolder}/src",
87+
"envFile": "${workspaceFolder}/src/.env",
88+
"console": "internalConsole",
89+
"stopAtEntry": false
90+
},
5591
{
5692
"name": ".NET Core Attach",
5793
"type": "coreclr",
5894
"request": "attach"
5995
}
6096
]
61-
}
97+
}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 2. Use the \\?\ prefix when specifying the path in the docker build command. e.g.
44
# docker build \\?\C:\path -f .\Dockerfile
55
# See https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
6-
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build-env
6+
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env
77

88
ARG MSGRAPH_NUGET_URL=https://nuget.pkg.github.com/microsoftgraph/index.json
99

@@ -16,7 +16,7 @@ WORKDIR /app/msgraph-cli
1616

1717
RUN dotnet publish -p:PublishSingleFile=false -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true ./src/msgraph-cli.csproj --configuration Release --no-self-contained --runtime linux-musl-x64 --output /app/output
1818

19-
FROM mcr.microsoft.com/dotnet/runtime:7.0-alpine as runtime
19+
FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine as runtime
2020

2121
# Change this password by providing a different value when running the container
2222
ENV KEYRING_PASSWORD="password"

src/msgraph-cli.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Microsoft.Graph.Cli</RootNamespace>
77
<ImplicitUsings>disable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
<AssemblyName>mgc</AssemblyName>
10-
<Version>1.1.1</Version>
10+
<Version>1.2.0</Version>
1111
</PropertyGroup>
1212

1313
<PropertyGroup>
@@ -57,7 +57,7 @@
5757
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
5858
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
5959
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
60-
<PackageReference Include="Microsoft.Graph.Cli.Core" Version="1.0.0" />
60+
<PackageReference Include="Microsoft.Graph.Cli.Core" Version="1.1.0" />
6161
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
6262
</ItemGroup>
6363

0 commit comments

Comments
 (0)