Crakenar
Crakenar

Reputation: 95

Encoding problem with ASP.NET Core MVC when uploading on IIS

I'm developing a website using ASP.NET Core MVC and Orchard Core. Right now I need to publish it on an IIS server. It works perfectly fine when using Visual Studio, but when I 'publish it' and then go on the website using the IP or the name, Firefox console tells me that :

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.

or the same but instead of 'text', there is 'html'.

I have already went through those questions&answers:

And downloaded an extension called Fix Filed Encoding.

Here is my web.config :

enter image description here

My files on IIS :

enter image description here

My code for the _layout :

enter image description here

My Controller for the default page : enter image description here

My startup.cs page : enter image description here

And the error in firefox console (but in French) :

enter image description here

I observed the network of firefox and had this : enter image description here

Could you help me or give me some hints Thanks in advance !

Upvotes: 0

Views: 1684

Answers (2)

Crakenar
Crakenar

Reputation: 95

So Orchard could not connect to the Databaseand could not recognize his own tables so I had to manually create them and it solved it.

Upvotes: 1

samwu
samwu

Reputation: 5205

Try to to set the responseEncoding attribute of the globalization element.

<configuration>
  <system.web>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
  </system.web>
</configuration>

Upvotes: 0

Related Questions