-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to run on .NET Aspire 9 (#48)
* Update to run on .NET Aspire 9 Updated TargetFramework to net8.0 in multiple projects. Upgraded Aspire and Microsoft package references to newer versions. Added new environment variables in launchSettings.json. Removed ProjectReference, Protobuf, and Compile items from .csproj files. Added dotnetRunMessages to launchSettings.json profiles. Included new using directives for Aspire.Hosting. Changed method call from project.GetName() to project.Name. Updated SDK in eShop.AppHost.csproj to Aspire.AppHost.Sdk 9.0.0. Removed eShop.ServiceDefaults project references and unused using directives. * Updates to labs and markdown for .NET Aspire 9.0 * Update target framework to .NET 9.0 and remove workload installation from build scripts * Bump global.json to 9.0 * Fix package downgrade issue * Markdown fixes * Bump doc references to 9.0 * Markdown fixes
- Loading branch information
1 parent
4d20224
commit 3fcdc98
Showing
102 changed files
with
302 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
@ECHO OFF | ||
|
||
dotnet workload install aspire | ||
|
||
dotnet build .\build\Build.proj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
dotnet workload install aspire | ||
|
||
dotnet build ./build/Build.proj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.100", | ||
"version": "9.0.100", | ||
"rollForward": "feature", | ||
"allowPrerelease": true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,13 @@ We're going to run 2 docker container:, the PostgreSQL container, and [pgAdmin]( | |
|
||
postgres | ||
|
||
``` | ||
```bash | ||
docker run --name postgres-dev -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 -d postgres | ||
``` | ||
|
||
pgAdmin | ||
|
||
``` | ||
```bash | ||
docker run --name pgadmin-dev -e PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False -e PGADMIN_CONFIG_SERVER_MODE=False -e [email protected] -e PGADMIN_DEFAULT_PASSWORD=admin -p 0:80 -d dpage/pgadmin4 | ||
``` | ||
|
||
|
@@ -65,15 +65,16 @@ docker run --name pgadmin-dev -e PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False - | |
1. Stop the application and try launching it again and seeing the output of the `/health` endpoint return `Degraded` while the database initialization is still in progress. | ||
1. Find the port assigned to the pgAdmin container. | ||
|
||
**Docker CLI** | ||
### Docker CLI | ||
|
||
``` | ||
|
||
```bash | ||
docker ps | ||
``` | ||
|
||
![Image of the docker CLI showing the port for pgAdmin](./img/find-docker-endpoint.png) | ||
|
||
**Docker Desktop** | ||
###Docker Desktop | ||
|
||
![Image of docker desktop UI showing the port for pgAdmin](./img/find-docker-endpoint-ui.png) | ||
|
||
|
@@ -108,7 +109,7 @@ Containers are extremely useful for hosting service dependencies, but rather tha | |
|
||
1. Run the following commands in the `src` folder to create the `eShop.AppHost` and `eShop.ServiceDefaults` projects. | ||
|
||
``` | ||
```bash | ||
dotnet new aspire-apphost -n eShop.AppHost | ||
dotnet new aspire-servicedefaults -n eShop.ServiceDefaults | ||
dotnet sln add eShop.AppHost | ||
|
@@ -117,7 +118,7 @@ Containers are extremely useful for hosting service dependencies, but rather tha | |
|
||
1. Now add a reference to the `eShop.AppHost`: | ||
|
||
``` | ||
```bash | ||
cd eShop.AppHost | ||
dotnet add reference ..\Catalog.Data.Manager | ||
``` | ||
|
@@ -141,7 +142,7 @@ Containers are extremely useful for hosting service dependencies, but rather tha | |
``` | ||
|
||
```xml | ||
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="8.2.0" /> | ||
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="9.0.0" /> | ||
``` | ||
|
||
1. Use the methods on the `builder` variable to create a PostgreSQL instance called `postgres` with pgAdmin enabled, and a database called `CatalogDB`. Ensure that the `catalog-db-mgr` project resource is configured with a reference to the `catalogDb`: | ||
|
@@ -345,6 +346,7 @@ Now that we've setup the solution to use Aspire for composing our distributed ap | |
|
||
### | ||
``` | ||
|
||
1. Click the **Send request** link displayed above it to send the request and have the response displayed: | ||
|
||
![Catalog.API.http file open in Visual Studio](./img/vs-catalog.api-http-file.png) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
labs/1-Create-Catalog-API/end/Catalog.Data/Catalog.Data.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<RootNamespace>eShop.Catalog.Data</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.2.0" /> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.2.24551.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
7 changes: 4 additions & 3 deletions
7
labs/1-Create-Catalog-API/end/eShop.AppHost/eShop.AppHost.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
labs/1-Create-Catalog-API/src/Catalog.Data/Catalog.Data.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<RootNamespace>eShop.Catalog.Data</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.2.0" /> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.2.24551.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
labs/2-Create-Blazor-Frontend/end/Catalog.API/Catalog.API.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
labs/2-Create-Blazor-Frontend/end/Catalog.Data/Catalog.Data.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<RootNamespace>eShop.Catalog.Data</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.2.0" /> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.2.24551.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
labs/2-Create-Blazor-Frontend/end/eShop.AppHost/eShop.AppHost.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
labs/2-Create-Blazor-Frontend/src/Catalog.API/Catalog.API.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
labs/2-Create-Blazor-Frontend/src/Catalog.Data/Catalog.Data.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<RootNamespace>eShop.Catalog.Data</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.2.0" /> | ||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.2.24551.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.