Reputation: 95
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:
Why am I getting a encoding error with my ASP.NET Core View?
The character encoding of the HTML document was not declared
And downloaded an extension called Fix Filed Encoding.
Here is my web.config
:
My files on IIS :
My code for the _layout :
My Controller for the default page :
And the error in firefox console (but in French) :
I observed the network of firefox and had this :
Could you help me or give me some hints Thanks in advance !
Upvotes: 0
Views: 1684
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
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