dotnet/orleans-templates

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NuGet Gitter

Overview

This project contains the templates for getting started with Orleans.

The templates are leveraging the dotnet templating engine.

Installation

The templates can be consumed in two ways.

Visual Studio 2017

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)

.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

Creating your first Orleans application

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
Congratulations, you created your first - yet empty - Orleans application.

Now you can add methods to the Grain interfaces project and Grain implementation project, then call it from the client application.

Building the template solution

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

Contribution

If you like to contribute to the development of Orleans Templates, here are some useful links about `dotnet` templates:

Blog

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!

Community

License

This project is licensed under the MIT license.

Quick Links

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.