Replies: 2 comments 6 replies
-
You can't access it inside of main. The host needs to be built before you can access anything there. The best you can do is set the content root. |
Beta Was this translation helpful? Give feedback.
6 replies
-
Can you please provide a code sample?
…On Tue, Sep 8, 2020 at 5:57 PM Chris Ross ***@***.***> wrote:
What about doing it inside of a IHostBuilder.ConfigureAppConfiguration
callback? As long as you registered that callback early enough...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25695 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKHUPP2SOHZY7P67OO4MBF3SE2SFLANCNFSM4RAH753A>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is my use case:
Download
appsettings.json
from an external trust store and place it inside the web application project root directory.I should do this inside
Program.cs -> Main
method as the first thing to be done beforeCreateWebHostBuilder
In order to achieve that, i need access to
IHostingEnvironment.ContentRootPath
Below is the code: i can declare a variable inside the
Main
method of typeIHostingEnvironment
but i am not sure what should i initialize it withBeta Was this translation helpful? Give feedback.
All reactions