You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AWS S3 SDK always tries to load log4net assembly even if logging is disabled or set to output to console
We have application where we provide Assembly Resolver to resolve plugin assemblies, on every application launch our resolver is called to load log4net assembly even if logging is disabled or set to output to console.
Expectation : If logging is disabled or set to output to console , library should try load log4net assembly
Reproduction Steps
publicclassAWSSample{privateconststringDllExtension=".dll";staticvoidMain(string[]args){// Assembly Resolver to load Plugin assembliesAssemblyLoadContext.Default.Resolving+=Default_Resolving;stringaccessKey="minioadmin";stringsecretKey="minioadmin";// do not store secret key hardcoded in your production source code!// Setting LoggingOptions.None also tries to load log4netAWSConfigs.Logging=LoggingOptions.Console;varconfig=newAmazonS3Config{RegionEndpoint=RegionEndpoint.USEast1,ServiceURL="http://localhost:9000",ForcePathStyle=true,// disabling loggingDisableLogging=true,Timeout=TimeSpan.FromSeconds(4)};varamazonS3Client=newAmazonS3Client(accessKey,secretKey,config);TransferUtilitytransferUtility=newTransferUtility(amazonS3Client);try{transferUtility.UploadDirectory(@"C:\Data\docs","demo");}catch(Exceptionexp){Console.WriteLine(exp.ToString());}}/// <summary>/// Assembly Resolver to load Plugin assemblies/// </summary>/// <param name="context"></param>/// <param name="arg2"></param>/// <returns></returns>privatestaticSystem.Reflection.AssemblyDefault_Resolving(AssemblyLoadContextcontext,System.Reflection.AssemblyNamearg2){varpath=Path.Combine(AppDomain.CurrentDomain.BaseDirectory,arg2.Name+DllExtension);try{if(File.Exists(path)){returncontext.LoadFromAssemblyPath(path);}Console.WriteLine($"Unable to locate {arg2.Name} at {path}");}catch(Exceptione){Console.WriteLine($"Unable to locate {arg2.Name} at {path}",e);}returnnull;}}
Logs
Environment
SDK Version: AWSSDK.S3 3.3.111.23
Package Version:AWSSDK.S3 3.3.111.23
OS Info: Windows 10
Build Environment Terminal dotnet
Targeted .NET Platform: .NET Core 3.1
Resolution
👋 I can/would-like-to implement a fix for this problem myself
This is a 🐛 bug-report
The text was updated successfully, but these errors were encountered:
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
The internal reflection for log4net has been removed in the upcoming V4 of the SDK. In V4 connecting the SDK's logging to a logging framework is done by including an adaptor package. Check out the logging section in the V4 tracker issue. #3362
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description
AWS S3 SDK always tries to load log4net assembly even if logging is disabled or set to output to console
We have application where we provide Assembly Resolver to resolve plugin assemblies, on every application launch our resolver is called to load log4net assembly even if logging is disabled or set to output to console.
Expectation : If logging is disabled or set to output to console , library should try load log4net assembly
Reproduction Steps
Logs
Environment
dotnet
Resolution
This is a 🐛 bug-report
The text was updated successfully, but these errors were encountered: