In my global.asax
I'm wiring up some services via AutoFac
for DI/IoC.
One of these services would like to know the domain name and port of the current website.
for example:-
builder.RegisterType<AuthenticationService>()
.As<IAuthenticationService>()
.WithParameter("localhostServer", new Uri(?????))
.SingleInstance();
this is some configuration stuff.
I have no idea how to pass in the server ip and port, via a new Uri instance when I'm doing this in my global.asax Application_Start()
Update: Server == IIS7, integrated mode. (not iis6 or classic mode).
I don't think there is a sure way to do this:
You probably need to do one of these things: