Base solution for your next web application
Open Closed

How to deploy ASP.NET Core MVC JQuery application to IIS Virtual Directory #7243


User avatar
0
oaalvarado created

Hi,

In the documentation there are instructions only to deploy to a website and not to a virtual directory in IIS. Could you please tell me the changes I need to make to be able to publish to a virtual directory in IIS? I'm getting the following errors:

Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-regular.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-500.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-300.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-500.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-300.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-regular.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-500.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-300.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)
poppins-v5-devanagari_latin-ext_latin-regular.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)

The application is looking for the resources in the root of the website and not in the virtual directory.

Thanks.


8 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    What is your Zero version? Is this problem only with Virtual Directory?

    Possible discussion related to this https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=10422&start=10&sid=0ba52bebb8bbb48af500f5fb5a79d92e

  • User Avatar
    0
    oaalvarado created

    Hi maliming,

    ASP.NET Zero Core MVC JQuery version is 7.0.0. If I run the application in Visual Studio 2017 it runs fine. If I publish it to a virtual directory, the errors in my first post are generated. As a test, I created a website in my computer and deployed the application to it, and it worked fine. But, as a requirement, I need to deploy the application to a virtual directory in a web server.

    I read the comments from the link you posted, but they are related to an Angular project deployed to Azure app service, so the issues are different.

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team

    Thanks, I will try it on my local IIS, I will reply you later.

  • User Avatar
    0
    maliming created
    Support Team

    hi oaalvarado I just confirmed that ASP NET CORE does not support IIS virtual directories.

    Virtual Directories IIS Virtual Directories aren't supported with ASP.NET Core apps. An app can be hosted as a sub-application.

    please see:https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/#virtual-directories

  • User Avatar
    1
    oaalvarado created

    Hi maliming,

    I didn't know that ASP.NET Core does not support IIS Virtual Directory. I will try to deploy it to an IIS sub-application to see if it works. I'll let you know the results.

    Thanks.

  • User Avatar
    0
    oaalvarado created

    Hi maliming,

    I tried to deploy to a website sub-application and I still get the errors. I'm guessing I need to update the href in layout.cshtml and login.cshtml to add the ~ so they can get the proper application path? Can you tell me which files I need to update the href?

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team

    There are many such paths that need to be modified.

    You can view the 404 link according to the chrome Network panel and then manually change it.

    Or search for keywords to find these pages.

  • User Avatar
    0
    oaalvarado created

    Thanks Maliming for your reply. I'll do what you suggested.