0

I can't find the problem inside my app configuration for IIS v10.

Seems like the web.config file has some issues (I checked a lot of time and can't find one).

I don't understand why these characters \\?\ appear before the path configured in web.config, when I try to access any feature of my website registered in IIS.

The web.config file is auto generated by Visual Studio when I publish the application. If I remove it, in browser will appear a 404 error which say that can not find a configuration file. Can't understand why physical path is missing (see in image)

If I run the exe file from app path (run or execute in cmd line), it will work (with development environment). Only from IIS I have problems.

I installed URL rewrite, again, no success (I see this is for IIS v7 only!?!?!)

Which can be the problem?

IIS v10

.Net Core v3.1

IIS app error

Browser page

web.config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\ShopApp.Server.API.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 9aed7aba-d024-42c9-8a99-b2b246e74195-->
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
AlleXyS
  • 2,476
  • 2
  • 17
  • 37
  • Did you verify that the web.config file is in the proper spot? Did you verify that IIS has the correct permissions to access the file? – mason Sep 26 '21 at 11:29
  • `web.config` is inside app folder. I deployed the app as self-contained mode. I think IIS have rights to read the files, because I have another app (clientside in Angular) which render the pages in browser. – AlleXyS Sep 26 '21 at 11:52
  • 1
    Did you [install the ASP.NET Core hosting runtime](https://dotnet.microsoft.com/download/dotnet/3.1), which includes the ASP.NET Core Module v2? Look for the "Hosting bundle" link. – mason Sep 26 '21 at 12:08
  • `0x8007000d` is generally an issue with the rewrite module. https://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads - supports IIS 7...10. Make sure you have the correct URLRewrite module installed (32/64bit) for your app. If you comment out the `location` element what message do you get back? – MisterSmith Sep 26 '21 at 13:01
  • Looks like I don't had `Hosting bundle` installed. Now, the error is HTTP Error 500.37 - ANCM Failed to Start Within Startup Time Limit. – AlleXyS Sep 26 '21 at 13:25
  • @MisterSmith That error code just means something went wrong with the web.config, and doesn't necessarily mean the URL Rewrite module is missing or even necessary. Since there's no evidence that the rewrite module is in use by this particular web.config, I see no reason to presumptively install it without more info. – mason Sep 26 '21 at 13:26
  • It's running :O damn, it's really works. thanks @mason. https://api.fare.ro/api/products/getRandomProducts I have a problem with a dependency package when I build the app and publish it (with remove previous files). wkhtmltox-v0.12.4 (from DinktoPdf) need to be copied manually from my source to published package, else the app will throw 500 err when is started. – AlleXyS Sep 26 '21 at 13:34
  • Nowhere I found a good answer with all requirements for `IIS` (including `Hosting Bundle`), please make your comment a reply to can check it as solution. Thanks again – AlleXyS Sep 26 '21 at 13:35
  • Microsoft indeed has poor documentation on all requirements, but i wrote a tool for that, https://docs.jexusmanager.com/tutorials/ancm-diagnostics.html – Lex Li Sep 26 '21 at 19:39

0 Answers0