Name: orleans-templates
Owner: .NET Foundation
Description: Templates for building Microsoft Orleans based solutions
Created: 2017-10-21 18:54:26.0
Updated: 2018-05-22 11:49:12.0
Pushed: 2018-04-12 21:07:45.0
Homepage: http://dotnet.github.io/orleans/
Size: 110
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This project contains the templates for getting started with Orleans.
The templates are leveraging the dotnet templating engine.
The templates can be consumed in two ways.
If you like to use the project templates from Visual Studio 2017, the minimum supported version is 15.3, since this version added support to the unfolding of templates based on the new dotnet templating engine.
VS Gallery link: Microsoft Orleans Templates
Template updates for Visual Studio 2017 can be done by updating the installed VSIX.
.NET Core command-line (CLI) template installation can be done by invoking `dotnet.exe
` from the shell. The minimum version required is 2.0.
et new --install Microsoft.Orleans.Templates:*
The template installation can be checked with the following command line:
et new
The output should contain the Orleans Templates amongst the other installed templates:
lates Short Name Language Tags
-----------------------------------------------------------------------------------------------------------------
ans Grain Class Collection grains [C#], F#, VB Orleans
ans Grain Interface Collection graininterfaces [C#], VB Orleans
ans Client Application clusterclient [C#] Orleans
ans Silo Host silohost [C#] Orleans
ans Grain Interface graininterface [C#] Orleans
The following commands should be executed from any CLI shell.
Create a Blank Solution:
et new sln -n Contoso
Create the Grain interfaces project and add it to the Solution:
et new graininterfaces -n Contoso.GrainInterfaces
et sln add Contoso.GrainInterfaces\Contoso.GrainInterfaces.csproj
Create the Grain implementation project and add it to the Solution:
et new grains -n Contoso.Grains
et sln add Contoso.Grains\Contoso.Grains.csproj
Add a project reference for the Grain interface project to the Grain implementation project:
et add Contoso.Grains reference Contoso.GrainInterfaces\Contoso.GrainInterfaces.csproj
Add `using Contoso.GrainInterfaces;
to the ``
Contoso.Grains\Grain1.cs``` file.
Create the Silo host project and add it to the Solution:
et new silohost -n Contoso.Silo
et sln add Contoso.Silo\Contoso.Silo.csproj
Add a project reference for the Grain implementation project to the Silo host project:
et add Contoso.Silo reference Contoso.Grains\Contoso.Grains.csproj
Add `using Contoso.Grains;
to the ``
Contoso.SiloHost\Program.cs``` file.
After the `UseConfiguration(config)
line in ``
Program.cs``` add, to register the grain classes with the Silo:
te a cluster client application and add it to the Solution:
dotnet new orleansclient -n Contoso.ClusterClient dotnet sln add Contoso.ClusterClient\Contoso.ClusterClient.csproj
a project reference for the Grain interface project to the Cluster Client application project:
dotnet add Contoso.ClusterClient reference Contoso.GrainInterfaces\Contoso.GrainInterfaces.csproj
```using Contoso.GrainInterfaces;``` to the ```Contoso.ClusterClient\Program.cs``` file.
r the ```UseConfiguration(config)``` line in ```Program.cs``` add, to register the grain interfaces with the client:
Build the solution:
et build
Now you can add methods to the Grain interfaces project and Grain implementation project, then call it from the client application.
The template project is an old style `csproj
, so it only can built with ``
MSBuild.exe```. Since the Package Restore is not automatic in this case that's must be done first.
Since NuGet workload was not part of VS Build payload before 15.4, on build servers 15.4 needed.
On a desktop Visual Studio 2017 installation a `Developer Command Prompt
` need to be opened, then the following 2 commands are building the solution:
ild /t:restore
ild
If you like to contribute to the development of Orleans Templates, here are some useful links about `dotnet
` templates:
Orleans Blog is a place to share our thoughts, plans, learnings, tips and tricks, and ideas, crazy and otherwise, which don?t easily fit the documentation format. We would also like to see here posts from the community members, sharing their experiences, ideas, and wisdom. So, welcome to Orleans Blog, both as a reader and as a blogger!
This project is licensed under the MIT license.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.