-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The AddMinio method does not add the IMinioClient to DI correctly #1046
Comments
+1 I encounter this issue. Current workaround would be to just new up MinioClient when needed and forget about DI |
The root cause is that the factory is creating minio with SSL enabled by default. Using DI will create the minio client using the factory (https://github.com/minio/minio-dotnet/blob/master/Minio/ServiceCollectionExtensions.cs#L47). This will create the @Maxaytt If you change your DI registration to the following builder.Services.AddMinio(configureClient => configureClient
.WithEndpoint(endpoint)
.WithCredentials(accessKey, secretKey)
.WithSSL(false)); Then it should work. |
Running into the exact same issue with an identical setup, .NET 8 & DI, with or without I'm currently trying to access the client using the following: builder.Services.AddMinio(configureClient => configureClient
.WithEndpoint("localhost", 9000)
.WithCredentials(
"realuser",
"veryrealpassword")
.WithSSL(false)
.Build()); Injection fails with both a factory and the standalone client. |
The server does not respond to any actions from the client.
I will describe my actions step by step:
I add minio server to docker compose:
further i added minio to di:
next step i added simple controller: for testing
i writed docker compose up. here are the logs:
next i send POST and GET requests to api:
the response should have been a list from one bucket, but nothing came
UPDATE:
I experimented a little more and realized that DI did not work. Instead of AddMinio, I tried to create a client object manually and everything worked
The text was updated successfully, but these errors were encountered: