Skip to content
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

feat: Better assembly resolution during dynamic loading #350

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aneojgurhem
Copy link
Contributor

No description provided.

var assemblyName = new AssemblyName(args.Name).Name;
var directoryName = Path.GetDirectoryName(args.RequestingAssembly.Location)!;

logger_.LogInformation("Trying to load {Assembly} from {Directory}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be Debug


PathDictionary[Path.GetDirectoryName(Assembly.GetCallingAssembly()
.Location)!] = true;
PathDictionary[Path.GetDirectoryName(typeof(CollocatedAssemblyResolver).Assembly.Location)!] = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iterate over AppDomain.CurrentDomain.GetAssemblies() instead ?


foreach (var kp in PathDictionary)
{
logger_.LogInformation("Trying to load {Assembly} from {Directory}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce number of logs written, move this log in the if : "Assembly found in Directory" and add a log for else "Assemble not found in Directory".

@CLAassistant
Copy link

CLAassistant commented Jun 23, 2023

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

Successfully merging this pull request may close these issues.

3 participants