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

SystemInfo.EntryAssemblyLocation writable to adjust location for config-files in unit test projects #91

Merged
merged 1 commit into from Aug 21, 2022

Conversation

FreeAndNil
Copy link
Contributor

@FreeAndNil FreeAndNil commented Aug 8, 2022

We would like to make SystemInfo.EntryAssemblyLocation writable so that we can adjust its value for unit test projects.
.net core sets "testhost.dll" as EntryAssembly.

@fluffynuts Could you please review?

Copy link
Contributor

@fluffynuts fluffynuts left a comment

Choose a reason for hiding this comment

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

looks fine to me, tho I can see an existing issue in the default block - Assembly.GetEntryAssembly() can return null; I'll merge and fix in master

@fluffynuts fluffynuts merged commit fa1b0af into apache:master Aug 21, 2022
@FreeAndNil
Copy link
Contributor Author

Thank you very much.

@fluffynuts
Copy link
Contributor

I'm not sure when this will land in a release; I'd like to work around an issue introduced recently which fixes something for pqsql but potentially breaks something for mssql (tho proper config of the latter works around it). Perhaps with that - but I need to set up a proper test scenario first.

@FreeAndNil
Copy link
Contributor Author

No problem. In the meantime I can release a version to our internal Nuget repo.

@FreeAndNil FreeAndNil deleted the Feature/EntryAssemblyLocation branch August 31, 2022 10:54
@smx-smx
Copy link

smx-smx commented Dec 14, 2022

Just chiming in to say that this also manifests when hosting .NET in C/C++ (via nethost/fxhost) through my .NET loader (https://github.com/smx-smx/EzDotnet)
If the loaded assembly uses log4net, Logger.Setup will fail and logging will not work at all.

This dirty hack works around it, but it's not portable and it can fail when debugging: https://gist.github.com/smx-smx/dc548226bcae16b57f9e6a44ca9d5f99

So i'm also looking forward to the next release 🙂

@FreeAndNil FreeAndNil added this to the 2.0.16 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants