-
Notifications
You must be signed in to change notification settings - Fork 58
IIS virtual directories #14
Comments
Should handle that based on the path passed into server.urls |
Yes, but how do you get that information from IIS to server.urls? Right now we only get the port. |
We'd need to restructure a bit. It can be setup in the M.A.Hosting.json file. |
Depends on aspnet/KestrelHttpServer#214 |
Workaround: put your app in a app.Map("/vdir" ... |
Please don't require us to hard code the IIS vdir in external config files, like M.A.Hosting.json, when IIS and HttpPlatformHandler already know this. Just pass this information on for example in an environment variable, like %HTTP_PLATFORM_VDIR%, so you can say
|
@rubenprins That fix is coming. This is a workaround until the fix is available. We're working with the httpPlatformHandler team to fix bugs found in beta8 and rc1. |
I don't understand the workaround. Are you saying we need to configure the sub-application within the parent application. Essentially copying the Configure method of the sub-application into the parent? |
Sup-apps have different paths (e.g. /subapp/controller/foo) which breaks routing. The workaround is to use Map("/subapp"... In your sub app to remove the extra path segment. |
I havent been able to get the workaround to work with an app configuration above. |
This as been fixed in AspNetCoreModule v0.8: #105. |
Asp.net core still not working under virtual directory in IIS |
@leo9223 virtual directories or sub applications? These are commonly confused. Sub applications should work but there's no support for virtual directories. |
@Tratcher Virtual directories are not working, but when I convert that directory to application then it is working. yea sub application is working. |
@Tratcher However different webconfigs working for IIS10 and IIS8.5 on IIS10 app works with this setting on IIS8.5 app works with this setting I don't know why. can you please tell me why it is happening? |
Your IIS 10 machine probably has dotnet on the system path, where your other machine doesn't. Did you restart the second machine after the install? |
@Tratcher I just restarted the IIS not the machine, let me check. Thank you |
@buddalasunil999 Web.Config files are inherited by child apps. inside your admin web.config in the handlers section you can remove the aspNetCore handler that was added in the parent site. |
@Tratcher Yeah just figured it out.. it's inherting the handler, added remove handler to child config and started working. Thanks |
@Tratcher you say "there's no support for virtual directories.". After I saw this comment I have searched everywhere to have it confirmed without finding anything on it, except in comments from you. Are you saying I will have to set up a new site and deploy there? So the setup below will never work because posservice is a virtual directory? What I need is to be able to call this web api url ? https://A.HTTPS.Site/posservice/api/v1/authentication/accesstoken My api controller attribute routing looks like
I have tried just about everything under the sun I believe (even some map #14 (comment) things).. so some help would be appreciated :-) |
Yes, if you made the posservice level a sub-application and pointed it at your ASP.NET Core app then it should work. Also remove the nested posservice/api and /posservice/api/v1 sub-applications definitions, they'll mess up your routing. Any segments marked as a sub-application get moved from HttpContext.Path to HttpContext.PathBase and Rout only operates on Path. |
Hi, Is there any way to get base path before on starup/configure (before request processing)? |
@evil-shrike why do you need it? |
@davidfowl I'm migrating some app/lib onto core from mvc5 and there I have some global singleton config (let's call it XConfig) which is available via DI for other components. I put the base path from ApplicationVirtualPath into that XConfig on start. |
Hi when i deploy asp.net core 2.0 with IIS Windows authentication I am getting Cors Error with angular. Please suggest any example |
When we're spun up behind IIS / HttpPlatformHandler how do we know what the virtual directory is? We need this to correctly set PathBase in the app. Ideally we'd set PathBase as part of the initial server address configuration, but at that point we're only given the port via environment variable.
@davidfowl
The text was updated successfully, but these errors were encountered: