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

LogManager.Setup().LoadConfigurationFromAssemblyResource() for Xamarin iOS + Android #4895

Merged
merged 1 commit into from
Apr 30, 2022

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Apr 30, 2022

When having changed NLog.config to have "Build Action" = "Embedded Resource", then you can do this:

NLog.LogManager.Setup().LoadConfigurationFromAssemblyResource(typeof(App).GetTypeInfo().Assembly);

This should work for both Xamarin iOS + Xamarin Android. Alternative to Xamarin Android Assets-folder, which NLog 5.0 no longer supports.

See also #4457 and NLog/NLog.Extensions.Logging#585

@sonarcloud
Copy link

sonarcloud bot commented Apr 30, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

75.0% 75.0% Coverage
0.0% 0.0% Duplication

@snakefoot snakefoot merged commit 1bddef8 into NLog:dev Apr 30, 2022
@snakefoot snakefoot deleted the LoadConfigurationFromAssemblyResource branch July 30, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant