Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
[submodule "sdkdocs/php"]
path = sdkdocs/php
url = https://github.com/dapr/php-sdk.git
[submodule "sdkdocs/dotnet"]
path = sdkdocs/dotnet
url = https://github.com/dapr/dotnet-sdk.git
[submodule "translations/docs-zh"]
path = translations/docs-zh
url = https://github.com/dapr/docs-zh.git
Expand All @@ -20,9 +17,6 @@
[submodule "sdkdocs/js"]
path = sdkdocs/js
url = https://github.com/dapr/js-sdk.git
[submodule "sdkdocs/pluggable-components/dotnet"]
path = sdkdocs/pluggable-components/dotnet
url = https://github.com/dapr-sandbox/components-dotnet-sdk
[submodule "sdkdocs/pluggable-components/go"]
path = sdkdocs/pluggable-components/go
url = https://github.com/dapr-sandbox/components-go-sdk
Expand Down
6 changes: 3 additions & 3 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ module:
- source: sdkdocs/php/daprdocs/content/en/php-sdk-docs
target: content/developing-applications/sdks/php
lang: en
- source: sdkdocs/dotnet/daprdocs/content/en/dotnet-sdk-docs
- source: sdkdocs/dotnet/content/en/dotnet-sdk-docs
target: content/developing-applications/sdks/dotnet
lang: en
- source: sdkdocs/dotnet/daprdocs/content/en/dotnet-sdk-contributing
- source: sdkdocs/dotnet/content/en/dotnet-sdk-contributing
target: content/contributing/sdk-contrib/
lang: en
- source: sdkdocs/go/daprdocs/content/en/go-sdk-docs
Expand All @@ -314,7 +314,7 @@ module:
- source: sdkdocs/rust/daprdocs/content/en/rust-sdk-contributing
target: content/contributing/sdk-contrib/
lang: en
- source: sdkdocs/pluggable-components/dotnet/daprdocs/content/en/dotnet-sdk-docs
- source: sdkdocs/pluggable-components/dotnet/content/en/dotnet-sdk-docs
target: content/developing-applications/develop-components/pluggable-components/pluggable-components-sdks/pluggable-components-dotnet
lang: en
- source: sdkdocs/pluggable-components/go/daprdocs/content/en/go-sdk-docs
Expand Down
1 change: 0 additions & 1 deletion sdkdocs/dotnet
Submodule dotnet deleted from 5338d9
25 changes: 25 additions & 0 deletions sdkdocs/dotnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Dapr .NET SDK documentation

This page covers how the documentation is structured for the Dapr .NET SDK.

## Dapr Docs

All Dapr documentation is hosted at [docs.dapr.io](https://docs.dapr.io), including the docs for the [.NET SDK](https://docs.dapr.io/developing-applications/sdks/dotnet/). Head over there if you want to read the docs.

### .NET SDK docs source

Although the docs site code and content is in the [docs repo](https://github.com/dapr/docs), the .NET SDK content and images are within the `content` and `static` directories, respectively.

This allows separation of roles and expertise between maintainers, and makes it easy to find the docs files you are looking for.

## Writing .NET SDK docs

To get up and running to write .NET SDK docs, visit the [docs repo](https://github.com/dapr/docs) to initialize your environment. It will clone both the docs repo and this repo, so you can make changes and see it rendered within the site instantly, as well as commit and PR into this repo.

Make sure to read the [docs contributing guide](https://docs.dapr.io/contributing/contributing-docs/) for information on style/semantics/etc.

## Docs architecture

The docs site is built on [Hugo](https://gohugo.io), which lives in the docs repo. This repo is setup as a git submodule so that when the repo is cloned and initialized, the dotnet-sdk repo, along with the docs, are cloned as well.

Then, in the Hugo configuration file, the `daprdocs/content` and `daprdocs/static` directories are redirected to the `daprdocs/developing-applications/sdks/dotnet` and `static/dotnet` directories, respectively. Thus, all the content within this repo is folded into the main docs site.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
type: docs
title: "Contributing to the .NET SDK"
linkTitle: ".NET SDK"
weight: 3000
description: Guidelines for contributing to the Dapr .NET SDK
---

# Welcome!
If you're reading this, you're likely interested in contributing to Dapr and/or the Dapr .NET SDK. Welcome to the project
and thank you for your interest in contributing!

Please review the documentation, familiarize yourself with what Dapr is and what it's seeking to accomplish and reach
out on [Discord](https://bit.ly/dapr-discord). Let us know how you'd like to contribute and we'd be happy to chime in
with ideas and suggestions.

There are many ways to contribute to Dapr:
- Submit bug reports for the [Dapr runtime](https://github.com/dapr/dapr/issues/new/choose) or the [Dapr .NET SDK](https://github.com/dapr/dotnet-sdk/issues/new/choose)
- Propose new [runtime capabilities](https://github.com/dapr/proposals/issues/new/choose) or [SDK functionality](https://github.com/dapr/dotnet-sdk/issues/new/choose)
- Improve the documentation in either the [larger Dapr project](https://github.com/dapr/docs) or the [Dapr .NET SDK specifically](https://github.com/dapr/dotnet-sdk/tree/master/daprdocs)
- Add new or improve existing [components](https://github.com/dapr/components-contrib/) that implement the various building blocks
- Augment the [.NET pluggable component SDK capabilities](https://github.com/dapr-sandbox/components-dotnet-sdk)
- Improve the Dapr .NET SDK code base and/or fix a bug (detailed below)

If you're new to the code base, please feel encouraged to ask in the #dotnet-sdk channel in Discord about how
to implement changes or generally ask questions. You are not required to seek permission to work on anything, but do
note that if an issue is assigned to someone, it's an indication that someone might have already started work on it.
Especially if it's been a while since the last activity on that issue, please feel free to reach out and see if it's
still something they're interested in pursuing or whether you can take over, and open a pull request with your
implementation.

If you'd like to assign yourself to an issue, respond to the conversation with "/assign" and the bot will assign you
to it.

We have labeled some issues as `good-first-issue` or `help wanted` indicating that these are likely to be small,
self-contained changes.

If you're not certain about your implementation, please create it as a draft pull request and solicit feedback
from the [.NET maintainers](https://github.com/orgs/dapr/teams/maintainers-dotnet-sdk) by tagging
`@dapr/maintainers-dotnet-sdk` and providing some context about what you need assistance with.

# Contribution Rules and Best Practices

When contributing to the [.NET SDK](https://github.com/dapr/dotnet-sdk) the following rules and best-practices should
be followed.

## Pull Requests
Pull requests that contain only formatting changes are generally discouraged. Pull requests should instead seek to
fix a bug, add new functionality, or improve on existing capabilities.

Do aim to minimize the contents of your pull request to span only a single issue. Broad PRs that touch on a lot of files
are not likely to be reviewed or accepted in a short timeframe. Accommodating many different issues in a single PR makes
it hard to determine whether your code fully addresses the underlying issue(s) or not and complicates the code review.

## Tests
All pull requests should include unit and/or integration tests that reflect the nature of what was added or changed
so it's clear that the functionality works as intended. Avoid using auto-generated tests that duplicate testing the
same functionality several times. Rather, seek to improve code coverage by validating each possible path of your
changes so future contributors can more easily navigate the contours of your logic and more readily identify limitations.

## Examples

The `examples` directory contains code samples for users to run to try out specific functionality of the various
Dapr .NET SDK packages and extensions. When writing new and updated samples keep in mind:

- All examples should be runnable on Windows, Linux, and MacOS. While .NET Core code is consistent among operating
systems, any pre/post example commands should provide options through
[tabpane]({{% ref "contributing-docs.md#tabbed-content" %}})
- Contain steps to download/install any required pre-requisites. Someone coming in with a fresh OS install should be
able to start on the example and complete it without an error. Links to external download pages are fine.

## Documentation

The `daprdocs` directory contains the markdown files that are rendered into the [Dapr Docs](https://docs.dapr.io) website. When the
documentation website is built this repo is cloned and configured so that its contents are rendered with the docs
content. When writing docs keep in mind:

- All rules in the [docs guide]({{% ref contributing-docs.md %}}) should be followed in addition to these.
- All files and directories should be prefixed with `dotnet-` to ensure all file/directory names are globally
- unique across all Dapr documentation.

All pull requests should strive to include both XML documentation in the code clearly indicating what functionality
does and why it's there as well as changes to the published documentation to clarify for other developers how your change
improves the Dapr framework.

## GitHub Dapr Bot Commands

Checkout the [daprbot documentation](https://docs.dapr.io/contributing/daprbot/) for Github commands you can run in this repo for common tasks. For example,
you can comment `/assign` on an issue to assign it to yourself.

## Commit Sign-offs
All code submitted to the Dapr .NET SDK must be signed off by the developer authoring it. This means that every
commit must end with the following:
> Signed-off-by: First Last <flast@example.com>

The name and email address must match the registered GitHub name and email address of the user committing the changes.
We use a bot to detect this in pull requests and we will be unable to merge the PR if this check fails to validate.

If you notice that a PR has failed to validate because of a failed DCO check early on in the PR history, please consider
squashing the PR locally and resubmitting to ensure that the sign-off statement is included in the commit history.

# Languages, Tools and Processes
All source code in the Dapr .NET SDK is written in C# and targets the latest language version available to the earliest
supported .NET SDK. As of v1.16, this means that both .NET 8 and .NET 9 are supported. The latest language version available
is [C# version 12](https://learn.microsoft.com/dotnet/csharp/whats-new/csharp-version-history#c-version-12)

Contributors are welcome to use whatever IDE they're most comfortable developing in, but please do not submit
IDE-specific preference files along with your contributions as these will be rejected.
91 changes: 91 additions & 0 deletions sdkdocs/dotnet/content/en/dotnet-sdk-docs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
type: docs
title: "Dapr .NET SDK"
linkTitle: ".NET"
weight: 1000
description: .NET SDK packages for developing Dapr applications
no_list: true
cascade:
github_repo: https://github.com/dapr/dotnet-sdk
github_subdir: daprdocs/content/en/dotnet-sdk-docs
path_base_for_github_subdir: content/en/developing-applications/sdks/dotnet/
github_branch: master
---

Dapr offers a variety of packages to help with the development of .NET applications. Using them you can create .NET clients, servers, and virtual actors with Dapr.

## Prerequisites
- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}})
- [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed

## Installation

To get started with the Client .NET SDK, install the Dapr .NET SDK package:

```sh
dotnet add package Dapr.Client
```

## Try it out

Put the Dapr .NET SDK to the test. Walk through the .NET quickstarts and tutorials to see Dapr in action:

| SDK samples | Description |
| ----------- | ----------- |
| [Quickstarts]({{% ref quickstarts %}}) | Experience Dapr's API building blocks in just a few minutes using the .NET SDK. |
| [SDK samples](https://github.com/dapr/dotnet-sdk/tree/master/examples) | Clone the SDK repo to try out some examples and get started. |
| [Pub/sub tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/pub-sub) | See how Dapr .NET SDK works alongside other Dapr SDKs to enable pub/sub applications. |

## Available packages

| Package Name | Documentation Link | Description |
|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| [Dapr.Client](https://www.nuget.org/packages/Dapr.Client) | [Documentation]({{% ref dotnet-client %}}) | Create .NET clients that interact with a Dapr sidecar and other Dapr applications. |
| [Dapr.AI](https://www.nuget.org/packages/Dapr.AI) | [Documentation]({{% ref dotnet-ai %}}) | Create and manage AI operations in .NET. |
| [Dapr.AI.A2a](https://www.nuget.org/packages/Dapr.AI.A2a) | | Dapr SDK for implementing agent-to-agent operations using the [A2A](https://github.com/a2aproject/a2a-dotnet) framework. |
| [Dapr.AI.Microsoft.Extensions](https://www.nuget.org/packages/Dapr.AI.Microsoft.Extensions) | [Documentation]({{% ref dotnet-ai-extensions-howto %}}) | Easily interact with LLMs conversationally and using tooling via the Dapr Conversation building block. |
| [Dapr.AspNetCore](https://www.nuget.org/packages/Dapr.AspNetCore) | [Documentation]({{% ref dotnet-client %}}) | Write servers and services in .NET using the Dapr SDK. Includes support and utilities providing richer integration with ASP.NET Core. |
| [Dapr.Actors](https://www.nuget.org/packages/Dapr.Actors) | [Documentation]({{% ref dotnet-actors %}}) | Create virtual actors with state, reminders/timers, and methods. |
| [Dapr.Actors.AspNetCore](https://www.nuget.org/packages/Dapr.Actors) | [Documentation]({{% ref dotnet-actors %}}) | Create virtual actors with state, reminders/timers, and methods with rich integration with ASP.NET Core. |
| [Dapr.Actors.Analyzers](https://www.nuget.org/packages/Dapr.Actors.Analyzers) | [Documentation]({{% ref dotnet-guidance-source-generators %}}) | A collection of Roslyn source generators and analyzers for enabling better practices and preventing common errors when using Dapr Actors in .NET. |
| [Dapr.Cryptography](https://www.nuget.org/packages/Dapr.Cryptography) | [Documentation]({{% ref dotnet-cryptography %}}) | Encrypt and decrypt streaming state of any size using Dapr's cryptography building block. |
| [Dapr.Jobs](https://www.nuget.org/packages/Dapr.Jobs) | [Documentation]({{% ref dotnet-jobs %}}) | Create and manage the scheduling and orchestration of jobs. |
| [Dapr.Jobs.Analyzers](https://www.nuget.org/packages/Dapr.Jobs.Analyzers) | [Documentation]({{% ref dotnet-guidance-source-generators %}}) | A collection of Roslyn source generators and analyzers for enabling better practices and preventing common errors when using Dapr Jobs in .NET. |
| [Dapr.DistributedLocks](https://www.nuget.org/packages/Dapr.DistributedLocks) | [Documentation]({{% ref dotnet-distributed-lock %}}) | Create and manage distributed locks for managing exclusive resource access. |
| [Dapr.Extensions.Configuration](https://www.nuget.org/packages/Dapr.Extensions.Configuration) | | Dapr secret store configuration provider implementation for `Microsoft.Extensions.Configuration`. |
| [Dapr.PluggableComponents](https://www.nuget.org/packages/Dapr.PluggableComponents) | | Used to implement pluggable components with Dapr using .NET. |
| [Dapr.PluggableComponents.AspNetCore](https://www.nuget.org/packages/Dapr.PluggableComponents.AspNetCore) | | Implement pluggable components with Dapr using .NET with rich ASP.NET Core support. |
| [Dapr.PluggableComponents.Protos](https://www.nuget.org/packages/Dapr.PluggableComponents.Protos) | | **Note:** Developers needn't install this package directly in their applications. |
| [Dapr.Messaging](https://www.nuget.org/packages/Dapr.Messaging) | [Documentation]({{% ref dotnet-messaging %}}) | Build distributed applications using the Dapr Messaging SDK that utilize messaging components like streaming pub/sub subscriptions. |
| [Dapr.Workflow](https://www.nuget.org/packages/Dapr.Workflow) | [Documentation]({{% ref dotnet-workflow %}}) | Create and manage workflows that work with other Dapr APIs. |
| [Dapr.Workflow.Analyzers](https://www.nuget.org/packages/Dapr.Workflow.Analyzers) | [Documentation]({{% ref dotnet-guidance-source-generators %}}) | A collection of Roslyn source generators and analyzers for enabling better practices and preventing common errors when using Dapr Workflows in .NET |

## More information

Learn more about local development options, best practices, or browse NuGet packages to add to your existing .NET
applications.

<div class="card-deck">
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Development</b></h5>
<p class="card-text">Learn about local development integration options</p>
<a href="{{% ref dotnet-integrations %}}" class="stretched-link"></a>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Best Practices</b></h5>
<p class="card-text">Learn about best practices for developing .NET Dapr applications</p>
<a href="{{% ref dotnet-guidance %}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>NuGet packages</b></h5>
<p class="card-text">NuGet packages for adding the Dapr to your .NET applications.</p>
<a href="https://www.nuget.org/profiles/dapr.io" class="stretched-link"></a>
</div>
</div>
</div>
<br />
Loading
Loading