1

When I've set up IIS Applications in the past, I've set them up looking like this:

enter image description here

When navigating it might look like this (in the browser):

http://MY-SERVER/VistaThemeTest/main.aspx

And If I click on a link, to another page, it might look like this:

http://MY-SERVER/VistaThemeTest/someOtherPage.aspx

I just tried to deploy a .net Core app to IIS:

enter image description here

The images are similar.

I go to http://MY-SERVER/CoreTestApp and it takes me to: http://MY-SERVER/CoreTestApp/Account/Login ... so far so good!

I log-in, and in my log-in process it performs a RedirectToAction to: http://MY-SERVER/CoreTestApp/Home/Main ... so far so good!

On this Main page I have navigation, I click on one of the links (which performs a RedirectToAction) and it takes me to: http://MY-SERVER/Home/ComponentRedirect?productcode=10330 ... not so good!

Notice that we lose the "CoreTestApp" in the URL?

If I take that url and change it to (manually in the browser): http://MY-SERVER/Home/CoreTestApp/ComponentRedirect?productcode=10330, my RedirectToAction works and I get sent to:

http://MY-SERVER/CoreTestApp/UserMaintenance

But that's not really in a great state, because once I start clicking within that page, my ajax calls fail (because of the missing CoreTestApp).

I don't understand why I'm losing "CoreTestApp" after I log-in. Has anyone experienced this?

JustLooking
  • 141
  • 5
  • 1
    I think that the problem is on the code, not on IIS. – Swisstone Aug 26 '19 at 19:50
  • I agree. As it works in the dev environment (IIS express). But that environment is http://localhost:port/, as opposed to http://localhost:port/some_virt_dir/ – JustLooking Aug 26 '19 at 19:52
  • 1
    Yes, ensure to use [RedirectToAction](https://docs.microsoft.com/en-us/dotnet/api/system.web.mvc.controller.redirecttoaction?view=aspnet-mvc-5.2) in your code, or [RedirectToRoute](https://docs.microsoft.com/en-us/dotnet/api/system.web.mvc.controller.redirecttoroute?view=aspnet-mvc-5.2). I think that you may get more answers if you ask your question on Stackoverflow – Swisstone Aug 26 '19 at 20:06

0 Answers0