asp.net web api - How to set web.config settings when selfhosting WebApi as a TopShelf windows service -
i have self hosted web api running windows service using topshelf. have app.config topshelf no web.config web api. if add together web.config or add together settings (web settings) app.config both ignored web api.
i need set following:
<system.web><identity impersonate="true" /></system.web>
but have no thought set it.
you're not hosting web api in iis
don't need web.config
. cannot use:
<system.web><identity impersonate="true" /></system.web>
as specific asp.net
(more details here).
why don't set credentials in windows service => "log on" configuration ?
or, using topshelf, code:
hostfactory.new(x => { x.runas("username", "password"); });
of course of study read username
, password
app.config
and, maybe, encrypt these values.
if want impersonate user there's not much can utilize low-level api. here can find explanation/solution.
asp.net-web-api owin self-hosting katana topshelf
No comments:
Post a Comment