Where I find the Web.Config no ASP.NET Core MVC 3.1?

I am having problems with accentuation in a View, I have already opened my view's in Notepad .cshtml and save all with UTF - 8 but is with accentuation problem in the application yet, I checked in all folders and did not find the Web.Config only the appsettings.json : (

Author: Rafael Vieira , 2020-07-08

1 answers

The real error was a little vague, but perhaps the answer below will solve your case.

I believe you have to create the web.config in hand, aspnet does not have it as default. On the question itself, if there is no globalized culture defined, it will pick up from the machine and if it is with foreign standard, it will have problems, perhaps.

In your view should have the following code: @System.Globalization.CultureInfo.CurrentUICulture

Remove it.

This can be solved by globalizing the App configuration in the class Startup in configure:

    var defaultCulture = new CultureInfo("pt-BR");
    var localizationOptions = new RequestLocalizationOptions
    {
        DefaultRequestCulture = new RequestCulture(defaultCulture),
        SupportedCultures = new List<CultureInfo> { defaultCulture },
        SupportedUICultures = new List<CultureInfo> { defaultCulture }
    };
    app.UseRequestLocalization(localizationOptions);

The App will instantiate with pt-BR as default

And in partial _ValidationScriptPartial you can add a javascript to validate according to how we use for example, separation of thousand and decimal, here in Brazil.

About webconfig, see this question: https://stackoverflow.com/questions/40186445/access-web-config-settings-in-asp-net-core-app

 1
Author: Henrique Mendes, 2020-07-30 18:52:53