Set CultureInfo in Asp.net Core to have a . as CurrencyDecimalSeparator instead of ,

后端 未结 6 973
清酒与你
清酒与你 2020-12-01 10:32

I\'m going mad. I just want the culture used in the entire Asp.net core application to be set to \"en-US\". But nothing seems to work. Where to I set the culture for the ent

6条回答
  •  没有蜡笔的小新
    2020-12-01 10:59

    Your code looks all fine. The issue is your call to

    app.UseRequestLocalization();
    

    Needs to happen before your call to

    app.UseMvc();
    

    The reason your breakpoint is never hit is because it never goes that far. UseMVC completes the request and returns the result. Remember, Middleware happens in order and any one of the middleware can shortcircuit the process and halt processing going any further.

提交回复
热议问题