erros after publish asp net mvc 5RSS

13 replies

Last post Nov 25, 2019 08:47 AM by Jalpa Panchal

  • erros after publish asp net mvc 5

    Nov 04, 2019 01:50 PM|Guto Godoy|LINK

    Hello everyone.
    I am not an expert on IIS and so I need your help. I am publishing an application made in asp net mvc 5 in visual studio 2017. In IIS I created a directory inside the defaut site directory, put the files generated by Visual studio into it and created an application. However it is giving several errors and I can not find a solution. The site loses formatting and the IIS application root directory.
    One of the mistakes was with fontawesome fonts that I manually set the font file directory to fix it, but it gets hard if with each new generation I need to manually fix it.


    Another was the same with signalr that I got right manually.


    The others I couldn't even get right are below:


    GET http://server/lagodoy/Content/AllCss/ net :: ERR_ABORTED 403 (Forbidden)
    serveriis.ddns.net/:23

    GET http://server/lagodoy/Content/css/?v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 net :: ERR_ABORTED 403 (Forbidden)
    (index): 22 GET http://server/lagodoy/Content/AllCss/ net :: ERR_ABORTED 403 (Forbidden)
    (index): 23 GET http://server/lagodoy/Content/css/?v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 net :: ERR_ABORTED 403 (Forbidden)

    Also if you get into some controller action it loses the lagodoy directory which is the root directory where i created the application on iis.


    I hope to explain to you so that you can understand and help me. If you need any more information please let me know that I already have.


    Thanks in advance for your help

  • Re: erros after publish asp net mvc 5

    Nov 05, 2019 01:53 AM|Jalpa Panchal|LINK

    To resolve the 403 forbidden issue you could try below steps:

    • Make sure you enabled anonymous authentication.

    • Assign all the permissions IUSR, IIS_IUSRS, NetworkService to the web application folder.
    • Try to use the below code in your web.config file:
    <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>

    after doing these changes if you still face the issue check the iis log for the sub status code. 

    Regards,

    Jalpa

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: erros after publish asp net mvc 5

    Nov 05, 2019 01:07 PM|Guto Godoy|LINK

    Hello Jalpa, first thanks for the feedback and help. Actually on my IIS server anonymous authentication is already enabled and the user is IUSR.
    The permissions for the wwwroot folder was already for IUSR, IIS_IUSRS and I added oser network services.
    My web config was already with runAllManagedModulesForAllRequests As below:

      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="BundleModule" />
          <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
          
          <remove name="FormsAuthentication" />
          <remove name="ApplicationInsightsWebTracking" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
          <remove name="TelemetryCorrelationHttpModule" />
          <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="managedHandler" />
        </modules>
        <validation validateIntegratedModeConfiguration="false" />
      </system.webServer>
    

    The log file looks like this:

    #Software: Microsoft Internet Information Services 10.0
    #Version: 1.0
    #Date: 2019-11-05 10:44:49
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
    2019-11-05 10:44:49 192.168.0.x GET / - 8080 - xx.xxx.xxx.xx Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 200 0 1236 25093
    #Software: Microsoft Internet Information Services 10.0
    #Version: 1.0
    #Date: 2019-11-05 10:00:58
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
    2019-11-05 10:44:49 192.168.0.x GET /manager/html - 8080 - xxx.xxx.xxx.xx Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.2;+WOW64;+Trident/6.0) - 404 0 64 491
    #Software: Microsoft Internet Information Services 10.0
    #Version: 1.0
    #Date: 2019-11-05 11:51:34
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
    2019-11-05 11:51:34 192.168.0.x PROPFIND /Caldav/ - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+WOW64;+rv:60.0)+Gecko/20100101+Thunderbird/60.9.0+Lightning/6.2.9 - 405 0 0 268
    2019-11-05 12:02:55 192.168.0.x GET / - 8080 - 185.115.101.5 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_11_6)+AppleWebKit/601.7.7+(KHTML,+like+Gecko)+Version/9.1.2+Safari/601.7.7 - 200 0 0 484
    2019-11-05 12:14:27 ::1 GET /lagodoy/Content/AllCss/ - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 403 14 0 97080
    2019-11-05 12:14:27 ::1 GET /lagodoy/Content/css/ v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 403 14 0 96836
    2019-11-05 12:14:42 ::1 GET /lagodoy/signalr/hubs - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 200 0 0 111964
    2019-11-05 12:14:48 ::1 GET /lagodoy/Content/css/ v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 403 14 0 34
    2019-11-05 12:14:48 ::1 GET /lagodoy/Content/AllCss/ - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 403 14 0 34
    2019-11-05 12:15:27 ::1 GET /favicon.ico - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 404 0 2 185
    2019-11-05 12:22:39 ::1 GET /lagodoy/signalr/hubs - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 200 0 0 462
    2019-11-05 12:22:39 ::1 GET /lagodoy/Content/css/ v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 403 14 0 462
    2019-11-05 12:22:39 ::1 GET /lagodoy/Content/AllCss/ - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 403 14 0 462
    2019-11-05 12:22:41 ::1 GET /favicon.ico - 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 404 0 2 108
    2019-11-05 12:22:41 ::1 GET /lagodoy/signalr/negotiate clientProtocol=2.0&connectionData=%5B%7B%22name%22%3A%22progresshub%22%7D%5D&_=1572956559460 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 http://localhost:8080/lagodoy 200 0 0 946
    2019-11-05 12:22:50 ::1 GET /lagodoy/signalr/connect transport=webSockets&clientProtocol=2.0&connectionToken=7xw7%2F31K71gkJcL4ncrxJIyg5L9DihglnopsRETqZLBOX89ENHOQoYocx47vjrzhdxBt%2F4bkRK09Pb9zQvs5KDou1oAAHtSfeOlQqkZ9zzk2Z1go6zuC%2FgP7x9%2BkG%2Brn&connectionData=%5B%7B%22name%22%3A%22progresshub%22%7D%5D&tid=9 8080 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.70+Safari/537.36 - 101 0 64 8476
    #Software: Microsoft Internet Information Services 10.0
    #Version: 1.0
    #Date: 2019-11-05 12:47:58
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
    2019-11-05 12:47:58 192.168.0.x GET /lagodoy/Content/AllCss/ - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 403 14 0 50677
    2019-11-05 12:47:58 192.168.0.x GET /lagodoy/Content/css/ v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 403 14 0 50574
    2019-11-05 12:47:58 192.168.0.x GET /lagodoy/signalr/hubs - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 200 0 0 51827
    2019-11-05 12:47:58 192.168.0.x GET /lagodoy/Content/css/ v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 403 14 0 56
    2019-11-05 12:47:58 192.168.0.x GET /lagodoy/Content/AllCss/ - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 403 14 0 120
    2019-11-05 12:47:59 192.168.0.x GET /lagodoy/signalr/negotiate clientProtocol=2.0&connectionData=%5B%7B%22name%22%3A%22progresshub%22%7D%5D&_=1572954422992 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 200 0 0 303
    2019-11-05 12:47:59 192.168.0.x GET /lagodoy/signalr/start transport=webSockets&clientProtocol=2.0&connectionToken=oFxKA6%2BQXuy8HTSzZrNTO%2Ftmh%2FFNiyM9FROi%2F7JQSLu7QLmIKop3p%2Bz1UZnSKc%2BcKR%2F%2FQJdJC8bc4kC%2Bs%2BFKZTZ91jgCFjGbn0soXRZgYH0BUNmOq2sUhVpgBAkWdQFh&connectionData=%5B%7B%22name%22%3A%22progresshub%22%7D%5D&_=1572954422993 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 200 0 0 61
    2019-11-05 12:47:59 192.168.0.x GET /favicon.ico - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 404 0 2 722
    2019-11-05 12:49:41 192.168.0.x GET /lagodoy/Content/AllCss/ - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 403 14 0 64
    2019-11-05 12:49:41 192.168.0.x GET /lagodoy/Content/css/ v=JiiChLocb3HM77o8UftPGHv_8d4cWfCsvJzKhoGKlig1 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 403 14 0 135
    2019-11-05 12:49:41 192.168.0.x GET /lagodoy/ - 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 - 200 0 0 147
    2019-11-05 12:53:57 192.168.0.x GET /lagodoy/signalr/ping _=1572954422994 8080 - xxx.xxx.xx.xxx Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/77.0.3865.120+Safari/537.36 http://myserver/lagodoy/ 200 0 0 7
    

    And the problem persists with the following errors:

    myserver/:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
    myserver/:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
    myserver/:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
    myserver/:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
    (index):38 init
    (index):51 bef04ca1-6530-4c4e-a771-716c3cd42885
    :8080/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    myserver/:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
    myserver/:1 Failed to load resource: the server responded with a status of 403 (Forbidden)
    

    plus the loss of formatting and the loss of path lagodoy when entering a controller action.

    Was there anything else I might be checking?

    Thanks again for the help.

    Luís

  • Re: erros after publish asp net mvc 5

    Nov 06, 2019 01:52 AM|Jalpa Panchal|LINK

    Hi,

    please check that you enabled asp.net 4.X framework feature of iis and your iis app pool is running under 4.X framework. you enabled directory browsing.

    if you are running x64, that you have enabled 32-bit applications in the app pool settings.

    you could also refer this below thread for more solutions.

    https://stackoverflow.com/questions/1741439/asp-mvc-in-iis-7-results-in-http-error-403-14-forbidden

    https://code-examples.net/en/q/1a927f

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: erros after publish asp net mvc 5

    Nov 07, 2019 01:13 PM|Guto Godoy|LINK

    Hello Jalpa,
    I checked the asp.net 4.X framework feature of iis and your app pool is running under 4.X framework and it's on.
    I turn true in 32-bit applications in the app pool settings.

    I did what I said in the links you provided, but it's still the same.


    Do you have any more ideas of what I can do?

    Thank you for your help

    Luís

  • Re: erros after publish asp net mvc 5

    Nov 08, 2019 02:12 AM|Jalpa Panchal|LINK

    Could you share your iis site authentication snapshot ?

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: erros after publish asp net mvc 5

    Nov 08, 2019 11:21 AM|Guto Godoy|LINK

    Yes, follow bellow....it is in Portuguese.

    autenticate

    wow .... I don't know how to share images here ...

    can you help me with this so i can put the image you requested?

  • Re: erros after publish asp net mvc 5

    Nov 11, 2019 01:59 AM|Jalpa Panchal|LINK

    you can share your image by using this link:

    https://imgur.com/upload

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: erros after publish asp net mvc 5

    Nov 14, 2019 02:22 PM|Guto Godoy|LINK

    Hello Jalpa,

    sorry for the delay, I've been solving other problems, below lowers the image you requested.

    sorry for being in portuguese, if you need to send the translation of some sentence of the image

  • Re: erros after publish asp net mvc 5

    Nov 21, 2019 07:40 AM|Jalpa Panchal|LINK

    Hi,

    please follow the below steps and gain try to publish your MVC project in iis.

    1)open the visual studio. Select your site and right-click on that-> Click publish.

    enter image description here

    2)in pick up publish target Select folder option and create choose destination where you want to publish the site. (make a new folder and publish a site in that folder) and then select publish.

    enter image description here

    3)open IIS manager.

    4)expand the server name and right-click on sites and select add a new site.

    enter image description here

    5)enter the site name, physical path, and site binding details.

    6) click ok and browse the site. 

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: erros after publish asp net mvc 5

    Nov 21, 2019 12:44 PM|Guto Godoy|LINK

    Hello, thanks again for your help,
    Here are photos of the steps you told me to do:

    1)open the visual studio. Select your site and right-click on that-> Click publish.

    iis1

    2)in pick up publish target Select folder option and create choose destination where you want to publish the site. (make a new folder and publish a site in that folder) and then select publish.

    iis2

    4)expand the server name and right-click on sites and select add a new site.

    iis3

    6) click ok and browse the site.

    iis4

    Unfortunately nothing has changed as before, the difference is that before the site was in an iis application in a sub folder of the default site and now I created a new site. The strange thing is that I have another application that works without problem on this same iis server.
    I've compared it to each other but I can't find the problem.

  • Re: erros after publish asp net mvc 5

    Nov 22, 2019 01:16 AM|Jalpa Panchal|LINK

    Hi,

    after publishing site did you copy that site file to another folder or just target the published folder in iis? 

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: erros after publish asp net mvc 5

    Nov 22, 2019 11:34 AM|Guto Godoy|LINK

    Hi,
    when i posted it i posted it in a temporary directory and then i copied it to the inetpub / wwwroot / site folder

  • Re: erros after publish asp net mvc 5

    Nov 25, 2019 08:47 AM|Jalpa Panchal|LINK

    if you want to move the published folder then move the whole folder do not copy the sub folders. and target that folder in iis.

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.