Local IIS not working with 4.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Everything working nicely with IISExpress so setup is generally ok.

Can't get it to work on IIS, have everything set up as I feel is a standard set up.

Getting error below which points to web.config, but can't find anything obvious, ideas?

Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <modules>
      <!-- Remove WebDAV module so that we can make DELETE requests -->
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <!-- Remove WebDAV module so that we can make DELETE requests -->
      <remove name="WebDAV" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <!-- When deploying on Azure, make sure that "dotnet" is installed and the path to it is registered in the PATH environment variable or specify the full path to it -->
    <aspNetCore requestTimeout="23:00:00" processPath="C:\Git\main\nopCommerce_4.3_Clean\Presentation\Nop.Web\bin\Debug\netcoreapp3.1\Nop.Web.exe" arguments="" forwardWindowsAuthToken="false" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600" hostingModel="InProcess">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
        <environmentVariable name="COMPLUS_ForceENC" value="1" />
      </environmentVariables>
    </aspNetCore>
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
        <!-- Protects against XSS injections. ref.: https://www.veracode.com/blog/2014/03/guidelines-for-setting-security-headers/ -->
        <add name="X-XSS-Protection" value="1; mode=block" />
        <!-- Protects against Clickjacking attacks. ref.: http://stackoverflow.com/a/22105445/1233379 -->
        <add name="X-Frame-Options" value="SAMEORIGIN" />
        <!-- Protects against MIME-type confusion attack. ref.: https://www.veracode.com/blog/2014/03/guidelines-for-setting-security-headers/ -->
        <add name="X-Content-Type-Options" value="nosniff" />
        <!-- Protects against Clickjacking attacks. ref.: https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet -->
        <add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains" />
        <!-- CSP modern XSS directive-based defence, used since 2014. ref.: http://content-security-policy.com/ -->
        <add name="Content-Security-Policy" value="default-src 'self'; connect-src *; font-src * data:; frame-src *; img-src * data:; media-src *; object-src *; script-src * 'unsafe-inline' 'unsafe-eval'; style-src * 'unsafe-inline';" />
        <!-- Prevents from leaking referrer data over insecure connections. ref.: https://scotthelme.co.uk/a-new-security-header-referrer-policy/ -->
        <add name="Referrer-Policy" value="same-origin" />
        <!--Feature-Policy is a new header that allows a site to control which features and APIs can be used in the browser. ref.: https://wicg.github.io/feature-policy/ -->
        <add name="Feature-Policy" value="accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment *; usb 'none'" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>


Error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:
Module     IIS Web Core
Notification     Unknown
Handler     Not yet determined
Error Code     0x8007000d
Config Error    
Config File     \\?\C:\Git\main\nopCommerce_4.3_Clean\Presentation\Nop.Web\web.config
Requested URL     http://localhost:80/
Physical Path    
Logon Method     Not yet determined
Logon User     Not yet determined

Config Source:
   -1:
    0:

From Microsoft it's saying web.config is the problem, but just don't see anything wrong with it...

HResult code 0x8007000d
Error message:

Server Error in Application "application name"
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x8007000d
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

Cause for HResult code 0x8007000d
This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element.

Resolution for HResult code 0x8007000d
Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file.
3 years ago
Huh, I ran it through an XML validator and it's valid XML, however this is suspect:

Config File     \\?\C:\Git\main\nopCommerce_4.3_Clean\Presentation\Nop.Web\web.config


I'm guessing that IIS cannot find the actual file.  Between IIS Express and regular IIS, are the sites pointing to the exact same directory?

Also, enable logging while you're at it:
stdoutLogEnabled="true"
3 years ago
Did you use publish option to deploy to local IIS ? or did the manual copy of files ?
3 years ago
kmsrao wrote:
Did you use publish option to deploy to local IIS ? or did the manual copy of files ?


did not publish.

not really a manual copy, just created website in IIS and pointed to source code files

C:\Git\main\nopCommerce_4.3_Clean\Presentation\Nop.Web

goal is to be able to have the site working locally without having to open VS and start the debugger (again, works great with IIS express, so high level things are 'working')

thx!
3 years ago
forgot to mention to make sure IIUSERS has folder permissions, or if using App Pool mapped to a user then that user has folder permissions
3 years ago
Multiple things happen when you publish from Visual Studio to the Local IIS. (This is the recommended way to do development also). Once you configure, deployment to the production server is just a change of server name and every thing works like charm.

The hard way is to manually do each step.
3 years ago
figured out was doing folder publish, trying iis now, ty


kmsrao wrote:
Multiple things happen when you publish from Visual Studio to the Local IIS. (This is the recommended way to do development also). Once you configure, deployment to the production server is just a change of server name and every thing works like charm.

The hard way is to manually do each step.
3 years ago
no help, same error


kmsrao wrote:
Multiple things happen when you publish from Visual Studio to the Local IIS. (This is the recommended way to do development also). Once you configure, deployment to the production server is just a change of server name and every thing works like charm.

The hard way is to manually do each step.
3 years ago
I can not run my development website in IIS but not without Visual Studio as there is a connection error I have not worked out
To run the development website in Visual Studio using IIS
I have a domain name configured in the DNS Hosts file
127.0.01     localtest43.selectsystems.com.au
Then I Create the Web in IIS and point it at C:\source43\Presentation\Nop.Web
Then bind the above domain in IIS to the website (both http:// and https://)
Then setup Visual Studio and run in Administrator mode
3 years ago
trying to get it working without having Visual Studio open, it shouldn't have to be.

this is a .netcore issue vs. just a nopcommerce issue.

i made a sample .net app, works fine.

sample .netcore app, same error as nopcommerece

so a .netcore error for all .netcore apps on my local box which in window 10 btw
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.