Kuinox
Kuinox
CC#
Created by Kuinox on 10/21/2024 in #help
A built in way to send SIGTERM ?
Hello there, is there a built in way to send a sigterm in .NET 8 ?
3 replies
CC#
Created by Kuinox on 3/6/2023 in #help
✅ Validation Error with Discord.Addons.Hosting
I'm trying to use Discord.Addons.Hosting, but it throws an OptionsValidationException . My main looks like this:
var host = new HostBuilder()
.ConfigureAppConfiguration( ( hostingContext, config ) =>
{
config.AddJsonFile( "appsettings.json", optional: false );
} )
.ConfigureLogging( x =>
{
x.AddConsole();
} )
.ConfigureDiscordHost( ( context, config ) =>
{
config.SocketConfig = new DiscordSocketConfig
{
LogLevel = LogSeverity.Debug,
AlwaysDownloadUsers = true,
GatewayIntents = GatewayIntents.All,
MessageCacheSize = 200
};
var openAIConfig = context.Configuration.GetSection( "OpenAPIConfig" ).Get<OpenAIAPIConfig>();
config.Token = openAIConfig.ApiKey;
} )
.UseInteractionService( (context, config) =>
{
config.UseCompiledLambda = true;
} )
.UseCommandService((context, config) =>
{
} )
.ConfigureServices( ( hostContext, services ) =>
{

services
.Configure<DiscordSocketConfig>( hostContext.Configuration.GetSection( "DiscordConfig" ) )
.Configure<KuinoxSemiAGI.DiscordConfig>( hostContext.Configuration.GetSection( "DiscordConfig" ) )
.AddSingleton<OpenAIAPI>()
.AddSingleton<DiscordAskChatGPT>()
;
} )
.Build();

await host.RunAsync();
var host = new HostBuilder()
.ConfigureAppConfiguration( ( hostingContext, config ) =>
{
config.AddJsonFile( "appsettings.json", optional: false );
} )
.ConfigureLogging( x =>
{
x.AddConsole();
} )
.ConfigureDiscordHost( ( context, config ) =>
{
config.SocketConfig = new DiscordSocketConfig
{
LogLevel = LogSeverity.Debug,
AlwaysDownloadUsers = true,
GatewayIntents = GatewayIntents.All,
MessageCacheSize = 200
};
var openAIConfig = context.Configuration.GetSection( "OpenAPIConfig" ).Get<OpenAIAPIConfig>();
config.Token = openAIConfig.ApiKey;
} )
.UseInteractionService( (context, config) =>
{
config.UseCompiledLambda = true;
} )
.UseCommandService((context, config) =>
{
} )
.ConfigureServices( ( hostContext, services ) =>
{

services
.Configure<DiscordSocketConfig>( hostContext.Configuration.GetSection( "DiscordConfig" ) )
.Configure<KuinoxSemiAGI.DiscordConfig>( hostContext.Configuration.GetSection( "DiscordConfig" ) )
.AddSingleton<OpenAIAPI>()
.AddSingleton<DiscordAskChatGPT>()
;
} )
.Build();

await host.RunAsync();
42 replies
CC#
Created by Kuinox on 11/1/2022 in #help
Error while compiling dotnet runtime
Hello, I get the following error while compuling dotnet/runtime with the command ./build.cmd -os Browser -subset mono+libs:
emcc : error : C:UsersKuinox.nugetpackagesmicrosoft.netcore.runtime.icu.transport8.0.0-alpha.1.22524.1runtimesbrowser-w asmnativelib/libicuuc.a: No such file or directory ("C:UsersKuinox.nugetpackagesmicrosoft.netcore.runtime.icu.transport 8.0.0-alpha.1.22524.1runtimesbrowser-wasmnativelib/libicuuc.a" was expected to be an input file, based on the commandli ne arguments provided) [C:\dev\runtime\src\mono\wasm\wasm.proj]
2 replies
CC#
Created by Kuinox on 10/19/2022 in #help
SignalR Get Client State From Another Service.
Hello, I have a SignalR client, and a method in another service that get called by the client with an HTTP requests. My client have a stateful object attached to it's Context.Items. When the other service receive the request, I can inject it a IHubContext, and with User(string) I can get a IClientProxy that allow to send messages to my client, but there is nothing to retrieve the stored Items. And I want to call a method on the object stored here, how should I do that ?
1 replies
CC#
Created by Kuinox on 9/20/2022 in #help
SQL Server Reactive view.
Hi, With SQL Server, I want to display the result of a query, and have dynamic update of the query. So when I insert a line, the line would immediately show up in my webapp. I don't use EFCore/EF but dapper. Multiple servers may update the DB. Ideally i'd like something where I don't update existing business logic, and not adding too much overhead.
1 replies
CC#
Created by Kuinox on 8/26/2022 in #help
Debugging code that emit types, bugged Type.FullName
Hello, I'm trying to debug some tool. It break since I started to use generics type, and try to emit new types based on it. My type fullname is the following:
CK.Cris.ICommandResult`1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Now the tool try to generate a new type name, and end up creating this fullname:
CK.Cris.ICommandResult`1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]_CK
Which look like invalid to me ? The .NET typebuilder then build a fullname by taking the last dot in the name, which pick up the version in the generic. There are exceptions that appear later, but i'm wondering if this in itself is not completly bugged (but I have no knowledge on these part of .NET). Where is the problem ? - Is that you shouldn't use Type.FullName, as a fullname when emitting a type ? - Is my Type.FullName is invalid ? - Does appending _CK at the end the only wrong thing happening here ?
1 replies
CC#
Created by Kuinox on 8/10/2022 in #help
EthernetIP and .NET
Does anyone have experience, experience, or heard about an EthernetIP library in .NET ? Company I work for will soon need to communicate with devices over EthernetIP, and I want inputs on it, as I will probably be the one who work on it.
190 replies