Coder Social home page Coder Social logo

dotnet-sdk's Introduction

Dapr SDK for .NET

Build Status codecov License: Apache FOSSA Status

Dapr SDK for .NET allows you to:

  • Interact with Dapr applications through a Dapr client
  • Build routes and controllers in ASP.NET
  • Implement the Virtual Actor model, based on the actor design pattern

This SDK can run locally, in a container, and in any distributed systems environment.

Releases

We publish nuget packages to nuget.org for each release.

Using nugets built locally in your project

<RepoRoot> is the path where you cloned this repository. Nuget packages are dropped under /bin/<Debug|Release>/nugets when you build locally.

Example

# Add Dapr.Actors nuget package
dotnet add package Dapr.Actors -s <RepoRoot>/bin/<Debug|Release>/nugets

# Add Dapr.Actors.AspNetCore nuget package
dotnet add package Dapr.Actors.AspNetCore -s <RepoRoot>/bin/<Debug|Release>/nugets

Documentation

The docs for the Dapr .NET SDK can be found on the Dapr docs site.

Examples

Visit the examples folder for a variety of examples to get you up and running with the Dapr .NET SDK.

Contributing

This repo builds the following packages:

  • Dapr.Client
  • Dapr.AspNetCore
  • Dapr.Actors
  • Dapr.Actors.AspNetCore
  • Dapr.Extensions.Configuration
  • Dapr.Workflow

Prerequisites

Each project is a normal C# project. At minimum, you need .NET 6.0 SDK to build, test, and generate NuGet packages.

Also make sure to reference the .NET SDK contribution guide

macOS/Linux:

On macOS or Linux we recommend Visual Studio Code with the C# Extension. See here for a getting started guide for VS Code and .NET.

Windows:

On Windows, we recommend installing the latest Visual Studio 2019 which will set you up with all the .NET build tools and allow you to open the solution files. Community Edition is free and can be used to build everything here.

Make sure you update Visual Studio to the most recent release.

Build

To build everything and generate NuGet packages, run dotnet cli commands. Binaries and NuGet packages will be dropped in a bin directory at the repo root.

# Build sdk, samples and tests.
dotnet build -c Debug  # for release, -c Release

# Run unit-test
dotnet test

# Generate nuget packages in /bin/Debug/nugets
dotnet pack

Each project can also be built individually directly through the CLI or your editor/IDE. You can open the solution file all.sln in repo root to load all sdk, samples and test projects.

dotnet-sdk's People

Contributors

aaroncrawfis avatar amanbha avatar amolenk avatar amulyavarote avatar bjorkstromm avatar cgillum avatar cmendible avatar dlemstra avatar energy164 avatar gmanvel avatar halspang avatar hhunter-ms avatar lmwf avatar lukekim avatar mregxn avatar philliphoff avatar ryanlettieri avatar rynowak avatar saber-wang avatar shaggygi avatar shalabhms avatar shivamkm07 avatar tcnghia avatar tmacam avatar tomkerkhove avatar vinayada1 avatar whitwaldo avatar yaron2 avatar yash-nisar avatar youngbupark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnet-sdk's Issues

Throw a custom Exception in Remoting, inner exception will be the serialized exception from user service code.

currently the code throws the exception directly on the client side which rewrites the call stack, the code should wrap the exception in another Exception.
Alternatively an Aggregate Exception can also be thrown with the actual exception as its inner exception. Since user code awaits on tasks, throwing AggregateExceptions will not be right thing to do as await should not throw AggregateException and instead unwrap.

Relationship with cloudevents/sdk-csharp

I'm digging through #74 - and there's a bunch of non-trivial stuff that CloudEvents do.

It's going to be easy to do #74 because the scope is very limited - but for the longer term, have you had any conversations with the maintainers of that project? Someone who wants to process CloudEvents other than their payload will likely end up using it - I'm hoping we can make that a good experience - however I haven't had the time to go deep into it.

This might be something for @davidfowl and I to chase.

Support CancellationToken for Remoting calls

Support CancellationToken in actor method calls with remoting. When CancellationToken is cancelled on the client side, the cnacellation token in remote method should be cancelled as well.

Build only for .net core 3.0

Proposal: This is the proposal to build cs-sdk for .netcore 3.0 only
This would put us on the most latest release for .netcore.

What it means for users: This would mean that user applications have to be built with .netcore 3.0. They will not be able to build full framework version.

What it means for partners during private preview: Since .netcore 3.0 is in preview, partners will have to install preview versions of .netcore 3.0 and preview versions of VS 2019 which support .netcore 3.0. It should be available in 1st week of Sept 2013 in VS 2019.

Cons: Users must target apps for .net core 3.0 (and higher), https://github.com/dotnet/standard/blob/master/docs/versions.md). This means that .net full framework apps cannot be developed using the sdk. .netcore 3.0 would be released in November and is currently in preview.

Pros: Puts us on the latest netcore version and only target .netcore workloads. If we build for .netstandard 2.0, we will have to continue to support it for the foreseeable future which would put extra burden on the team since .Net Framework will not support newer .netstandard versions.
gRPC is supported in aspnetcore starting with aspnetcore 3.0

Amount of work needed: Update the CI, update dev environments and .csproj, use new apis available in .netcore3.0 and aspnetcore 3.0

So it simply boils down to the decision if we want to only support .netcore and not .net full framework moving forward?
cc: @msfussell @shalabhms @lukekim

Serialize actor state as json by default

Serialize actor state as json by default, currently the state is DataContract serializable to follow the Service Fabric reliable Actor models. Change the behavior to serialize state as json and consider adding a compatibility option as an attribute on Actor type for allowing Data Contract serialization for state so that SF Reliable Actors can also run using Dapr

Enable RPC like calls using ActorProxy.

Add codegen to enable RPC like calls using ActorProxy to allow following strongly typed invocations:

// This only creates a proxy object, it does not activate an actor or invoke any methods yet.
IMyActor myActor = ActorProxy.Create<IMyActor>("ActorType")
// This will invoke a method on the actor. 
myActor.DoWorkAsync();

Moar gRPC?

Now that we've got a gRPC client - do we want to take a more thorough look at the experience for ASP.NET Core + gRPC + Dapr? I happen to know a guy.

At this minimum this would probably be a review of some of the practices + more samples, at the maximum we might identify more features and integration points.

Add Actor runtime core components to sdk.

Add following runtime components to SDK:

  1. Actor registration.
  2. Actor activation/deactivation.
  3. Method invocation.
  4. Reminder/Timer firing.
  5. Actor state management.
  6. Add routes for activation, deactivation, method, reminder, timer invocation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.