languages | products | page_type | name | urlFragment | description | ||||
---|---|---|---|---|---|---|---|---|---|
|
|
sample |
Orleans Voting sample app on Aspire |
orleans-voting-sample-app-on-aspire |
An Orleans sample demonstrating a voting app on Aspire. |
This is a simple .NET app that shows how to use Orleans with .NET Aspire orchestration.
- How to configure a .NET Aspire app to work with Orleans
This sample is written in C# and targets .NET 8.0. It requires the .NET 8.0 SDK or later.
To download and run the sample, follow these steps:
- Clone the
dotnet/aspire-samples
repository. - In Visual Studio (2022 or later):
- On the menu bar, choose File > Open > Project/Solution.
- Navigate to the folder that holds the sample code, and open the solution (.sln) file.
- Right click the OrleansVoting.AppHost project in the solution explore and choose it as the startup project.
- Choose the F5 key to run with debugging, or Ctrl+F5 keys to run the project without debugging.
- From the command line:
- Navigate to the folder that holds the sample code.
- At the command line, type
dotnet run
.
To run the game, run the .NET Aspire app by executing the following at the command prompt (opened to the base directory of the sample):
dotnet run --project OrleansVoting.AppHost
- On the Resources page, click on one of the endpoints for the listed project. This launches the simple .NET app.
- In the .NET app:
- Enter a poll title, some questions, and click Create, or click DEMO: auto-fill poll to auto-fill the poll.
- On the poll page, Click one of the poll options to vote for it.
- The results of the poll are displayed. Click the DEMO: simulate other voters button to simulate other voters voting on the poll and watch the results update.
For more information about using Orleans, see the Orleans documentation.