Skip to content

Pass Kernel instance when starting Dapr process in C# #11540

Answered by alliscode
chris-coop asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @chris-coop, you are correct, there is no way to directly pass a Kernel instance to the process when using Dapr. The reason for this is that Dapr is intended to run as a distributed multi server system and there is no way to pass Kernel instances around between servers.

When using the Dapr runtime, the Kernel instance needs to be configured via dependency injection. An example of configuring the Kernel in DI for Dapr can be seen here: https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Demos/ProcessWithCloudEvents/ProcessWithCloudEvents.Grpc/Program.cs#L26

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@moonbox3
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sophialagerkranspandey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
.NET Issue or Pull requests regarding .NET code processes
4 participants