Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A reference .NET application implementing an eCommerce site

License

NotificationsYou must be signed in to change notification settings

dotnet/eShop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

A reference .NET application implementing an e-commerce website using a services-based architecture using.NET Aspire.

eShop Reference Application architecture diagram

eShop homepage screenshot

Getting Started

This version of eShop is based on .NET 9.

Previous eShop versions:

Prerequisites

Windows with Visual Studio

  • InstallVisual Studio 2022 version 17.10 or newer.
    • Select the following workloads:
      • ASP.NET and web development workload.
      • .NET Aspire SDK component inIndividual components.
      • Optional:.NET Multi-platform App UI development to run client apps

Or

  • Run the following commands in a Powershell & Terminal running asAdministrator to automatically configure your environment with the required tools to build and run this application. (Note: A restart is required and included in the script below.)
install-Module-Name Microsoft.WinGet.Configuration-AllowPrerelease-AcceptLicense-Force$env:Path= [System.Environment]::GetEnvironmentVariable("Path","Machine")+";"+ [System.Environment]::GetEnvironmentVariable("Path","User")get-WinGetConfiguration-file .\.configurations\vside.dsc.yaml|Invoke-WinGetConfiguration-AcceptConfigurationAgreements

Or

  • From Dev Home go toMachine Configuration -> Clone repositories. Enter the URL for this repository. In the confirmation screen look for the sectionConfiguration File Detected and clickRun File.

Mac, Linux, & Windows without Visual Studio

Or

  • Run the following commands in a Powershell & Terminal running asAdministrator to automatically configuration your environment with the required tools to build and run this application. (Note: A restart is required after running the script below.)
Install Visual Studio Code and related extensions
install-Module-Name Microsoft.WinGet.Configuration-AllowPrerelease-AcceptLicense-Force$env:Path= [System.Environment]::GetEnvironmentVariable("Path","Machine")+";"+ [System.Environment]::GetEnvironmentVariable("Path","User")get-WinGetConfiguration-file .\.configurations\vscode.dsc.yaml|Invoke-WinGetConfiguration-AcceptConfigurationAgreements

Note: These commands may requiresudo

Note: When running on Mac with Apple Silicon (M series processor), Rosetta 2 for grpc-tools.

Running the solution

Warning

Remember to ensure that Docker is started

  • (Windows only) Run the application from Visual Studio:
  • Open theeShop.Web.slnf file in Visual Studio
  • Ensure thateShop.AppHost.csproj is your startup project
  • Hit Ctrl-F5 to launch Aspire
  • Or run the application from your terminal:
dotnet run--project src/eShop.AppHost/eShop.AppHost.csproj

then look for lines like this in the console output in order to find the URL to open the Aspire dashboard:

Login to the dashboard at: http://localhost:19888/login?t=uniquelogincodeforyou

You may need to install ASP.NET Core HTTPS development certificates first, and then close all browser tabs. Learn more athttps://aka.ms/aspnet/https-trust-dev-cert

Azure Open AI

When using Azure OpenAI, insideeShop.AppHost/appsettings.json, add the following section:

"ConnectionStrings": {"OpenAi":"Endpoint=xxx;Key=xxx;"  }

Replace the values with your own. Then, in the eShop.AppHostProgram.cs, set this value totrue

booluseOpenAI=false;

Here's additional guidance on the.NET Aspire OpenAI component.

Use Azure Developer CLI

You can use theAzure Developer CLI to run this project on Azure with only a few commands. Follow the next instructions:

  • Install the latest or update to the latestAzure Developer CLI (azd).
  • Log inazd (if you haven't done it before) to your Azure account:
azd auth login
  • Initializeazd from the root of the repo.
azd init
  • During init:

    • SelectUse code in the current directory. Azd will automatically detect the .NET Aspire project.
    • Confirm.NET (Aspire) and continue.
    • Select which services to expose to the Internet (exposingwebapp is enough to test the sample).
    • Finalize the initialization by giving a name to your environment.
  • Create Azure resources and deploy the sample by running:

azd up

Notes:

  • The operation takes a few minutes the first time it is ever run for an environment.
  • At the end of the process,azd will display theurl for the webapp. Follow that link to test the sample.
  • You can runazd up after saving changes to the sample to re-deploy and update the sample.
  • Report any issues toazure-dev repo.
  • FAQ and troubleshoot for azd.

Contributing

For more information on contributing to this repo, readthe contribution documentation andthe Code of Conduct.

Sample data

The sample catalog data is defined incatalog.json. Those product names, descriptions, and brand names are fictional and were generated usingGPT-35-Turbo, and the correspondingproduct images were generated usingDALL·E 3.

eShop on Azure

For a version of this app configured for deployment on Azure, please viewthe eShop on Azure repo.

About

A reference .NET application implementing an eCommerce site

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp