pirrippu
pirrippu
CC#
Created by pirrippu on 10/14/2024 in #help
Windows Authentication
Hello, I have this blazor application that uses Windows Authentication. Everything works well but not on some deployments, I know Negotiate should only use HTTP1.1 but in some of these deployments it only uses HTTP2 and doesn't try to downgrade. I have checked everything I know including kestrel which I already use HTTP1andHTTP2
1 replies
CC#
Created by pirrippu on 4/16/2024 in #help
✅ Updating packages in Directory.Packages.props
How do you upgrade nugets in your Directory.Packages.props with CentralPackageTransitivePinningEnabled set to true? I always have issues in updating few packages using Visual Studio, as a workaround I manually update package versions in the file instead and resolve issues manually. Is there any better way to do this?
11 replies
CC#
Created by pirrippu on 8/1/2023 in #help
✅ SQL Command Timeout does not work with async calls
Has anyone encountered the following issue? When using a sync call to the database, the command timeout parameter works, but when I'm using an async call it does not work? See sample code below:
var connection = new MySqlConnection("***");await connection.OpenAsync();
var command = new MySqlCommand("select Count(Id) from eventlog", connection);
command.CommandTimeout = 10;

// Hits the exception at 10 second mark
var count = command.ExecuteScalar();

// Executes indefinitely
var count = await command.ExecuteScalarAsync(cancellationToken);
var connection = new MySqlConnection("***");await connection.OpenAsync();
var command = new MySqlCommand("select Count(Id) from eventlog", connection);
command.CommandTimeout = 10;

// Hits the exception at 10 second mark
var count = command.ExecuteScalar();

// Executes indefinitely
var count = await command.ExecuteScalarAsync(cancellationToken);
Removing the CommandTimeout, meaning using the default timeout of 30 seconds, works for sync calls but not with async calls. I tried adding a connection timeout and it also does not work. I tried using Dapper, and it also does not work. Am I missing something or what?
25 replies
CC#
Created by pirrippu on 4/23/2023 in #help
❔ Strategy for plugin architecture dependency injection
I am creating an application with simple plugins in which registration information of plugins are stored in a database. I am having challenges with dependency injection. Each plugin assembly has the following marker assembly:
csharp
public interface IPluginRegistrar
{
IServiceCollection RegisterPluginServices(IServiceCollection services);
}
csharp
public interface IPluginRegistrar
{
IServiceCollection RegisterPluginServices(IServiceCollection services);
}
Idea is to call the interface above for each of plugin assemblies stored in the database, but I cannot resolve my plugin DbContext without doing BuildServiceProvider() which I cannot do(or not advised to do) during ConfigureServices(). Is there any strategy or pattern to tackle this?
33 replies