Cannot find System.Xaml in .net 6

I created a console application with a target framework of .net 6.0 in order to write a custom Xaml writer. This is the project configuration: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> I want to extend the XamlXmlWriter class but I can’t import it. If I add using System.Xaml I get: The type or… Read More Cannot find System.Xaml in .net 6

StartAsync not triggered when RunAsync is called from Console Application

I’m trying to use dependency injection from a .NET 6 console application. I’ve got a class called Startup which inherits from IHostedService and it has both the StartupAsync and StopAsync functions defined: public async Task StartAsync(CancellationToken cancellationToken) { Console.WriteLine("Host started!"); return Task.CompletedTask; } public Task StopAsync(CancellationToken cancellationToken) { Console.WriteLine("Host stopped!"); return Task.CompletedTask; } And from… Read More StartAsync not triggered when RunAsync is called from Console Application

C# Wait for function but with a timeout. How do I make my function async?

I have the same requirement as the poster in Async wait. I want to wait for a function to return but also set a timeout value. I want to use the part : int timeout = 1000; var task = SomeOperationAsync(); if (await Task.WhenAny(task, Task.Delay(timeout)) == task) { // task completed within timeout } else… Read More C# Wait for function but with a timeout. How do I make my function async?

Adding Service from dynamically loaded Assembly to ServiceCollection?

maybe someone can help me out with this one: I’m writing a Program, that dynamically loads assemblies that have different implementations of the same interface "IMyService". The case may occur, that some of the assemblies aren’t even there (imagine this as a set of different modules of a software a user can buy… Some are… Read More Adding Service from dynamically loaded Assembly to ServiceCollection?

From a GRPC Project, call a method on another GRPC project, in a different solution

I’m using GRPC in C#, I already have a GRPC Project that uses its locals methods / proto classes, but don’t know how to call a method that’s in a different GRPC service that I referenced my adding the corresponding Nuget Package. Do I need to create that service proto method again? I’m not sure… Read More From a GRPC Project, call a method on another GRPC project, in a different solution