Marco Slanzi
Marco Slanzi

Reputation: 1

CORS configuration error with IIS express (from a fresh workstation install)

I moved in a new workstation and I have reinstalled IIS Express. Also, I have installed CORS module because my application is using .net 4.8 with Visual Studio 2019

But when I try to start the application, I am stuck in configuration errors, even if I have copied DLL and schema files in IIS Express files and default applicationhost.config

The strange thing is that if I remove the cors section in web.config file, I have a 500.60 CORS error, but when I insert the section in Web.config, I have 500.19 error

this is the section I use:

<cors enabled="true" failUnlistedOrigins="true">
  <add origin="*">
    <allowHeaders allowAllRequestedHeaders="true" />
    <allowMethods>
      <add method="GET" />
      <add method="POST" />
    </allowMethods>
  </add>
  <add origin="http://*" allowed="false" />
</cors>

Anyone has the same problem?

Upvotes: 0

Views: 281

Answers (1)

Lex Li
Lex Li

Reputation: 63254

You need to install the IIS CORS module to IIS Express, and the steps are not trivial.

But I wrote about that and made a few PowerShell scripts to help.

Upvotes: 0

Related Questions