currentuiculture

Error MSB4185: “System.Globalization.CultureInfo” has not been enabled for execution

回眸只為那壹抹淺笑 提交于 2019-12-22 04:19:14
问题 When trying to build in MonoDevelop with Mono for Android I get this error. According to the debug it is not located in my code so im left clueless. Any idea? Error MSB4185: The function "CurrentUICulture" on type "System.Globalization.CultureInfo" has not been enabled for execution. (MSB4185) 回答1: I own MSBuild (and this code). It's an error originating in the file microsoft.csharp.targets, as the error message probably says. In there is a property function: $([System.Globalization

.NET Globalization: Set Culture/UICulture on a Page or a Thread? What's the difference?

二次信任 提交于 2019-12-11 12:51:44
问题 Question title is basically the entire question. In ASP.NET you can set the Culture/UICulture properties of a page by overriding the InitializeCulture method, or you can set the properties of the current thread. What are the differences? What are the advantages/disadvantages of both? What situations would you use each option? 回答1: Both approaches ultimately set the properties on the current thread. The biggest difference is that the Page methods support automatic language detection - they can

ASP.NET MVC (Async) CurrentCulture is not shared between Controller and View

谁说胖子不能爱 提交于 2019-12-10 02:48:44
问题 I have an ASP.NET MVC 4 application that is targeting .NET Framework 4.7.1, with the problem that the culture is not shared between Controller and View, if the action contains async calls. I am referencing the NuGet package Microsoft.AspNet.Mvc 5.2.3 (and can be reproduced in 5.2.4). This is the code in the Controller: public class CulturesTestController : Controller { public async Task<ActionResult> Index(string value) { Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fi-FI

ASP.NET Web Page Globalization & Localization in Master Page C# 3.0

强颜欢笑 提交于 2019-12-09 13:48:09
问题 I cant use the following code in Master page for Globalization & Localization. It gives the error as commented in the code part "does not contain a defination for InitializeCulture" protected override void InitializeCulture() { if (Request["Language"] != null) { //String selectedLanguage = Request["Language"]; // code wil go here } base.InitializeCulture(); //base.InitializeCulture gives error as mentioned in the next line //does not contain a defination for InitializeCulture } When i add

Localizable WPF Application - UICulture settings lead to Resource problems

懵懂的女人 提交于 2019-12-06 03:21:18
I want to create aa localizable WPF Application. I've followed the instructions in the comments of the AssemblyInfo.cs file: //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. After I've done this, my application isn't starting any more. I'm

Error MSB4185: “System.Globalization.CultureInfo” has not been enabled for execution

。_饼干妹妹 提交于 2019-12-05 02:57:45
When trying to build in MonoDevelop with Mono for Android I get this error. According to the debug it is not located in my code so im left clueless. Any idea? Error MSB4185: The function "CurrentUICulture" on type "System.Globalization.CultureInfo" has not been enabled for execution. (MSB4185) I own MSBuild (and this code). It's an error originating in the file microsoft.csharp.targets, as the error message probably says. In there is a property function: $([System.Globalization.CultureInfo]::CurrentUICulture.Name) What the error means is that it thinks that this function isn't in MSBuild's

ASP.NET MVC (Async) CurrentCulture is not shared between Controller and View

删除回忆录丶 提交于 2019-12-05 01:31:22
I have an ASP.NET MVC 4 application that is targeting .NET Framework 4.7.1, with the problem that the culture is not shared between Controller and View, if the action contains async calls. I am referencing the NuGet package Microsoft.AspNet.Mvc 5.2.3 (and can be reproduced in 5.2.4). This is the code in the Controller: public class CulturesTestController : Controller { public async Task<ActionResult> Index(string value) { Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fi-FI"); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fi-FI"); var model = new

ASP.NET Web Page Globalization & Localization in Master Page C# 3.0

不想你离开。 提交于 2019-12-03 21:09:41
I cant use the following code in Master page for Globalization & Localization. It gives the error as commented in the code part "does not contain a defination for InitializeCulture" protected override void InitializeCulture() { if (Request["Language"] != null) { //String selectedLanguage = Request["Language"]; // code wil go here } base.InitializeCulture(); //base.InitializeCulture gives error as mentioned in the next line //does not contain a defination for InitializeCulture } When i add this code to other pages other than Master Page it works fine. is there any restriction on using this code

CurrentUICulture ignores Region and Language settings

风流意气都作罢 提交于 2019-12-01 05:09:52
Assorted settings in the Windows 7 Region and Language dialog supply values to the properties of the CurrentCulture object. However, WPF controls seem to use CurrentUICulture instead, resulting in a total failure to respect the user's preferences. On my workstation, for example, WPF controls seem to use CurrentUICulture which is en-US, causing them to display dates with the American format M/d/yyyy rather than the Australia format specified in the Region and Language dialog. Explicitly specifying a culture of en-AU in a databinding causes the control in question to to use default Australian

Change UI culture in WinRT

南笙酒味 提交于 2019-12-01 03:42:52
Is it possible to change the UI Culture in WinRT on-the-fly? I've found ApplicationLanguages.PrimaryLanguageOverride = "en"; , but this only works before showing the app UI and not afterwards (e.g. I want to change the UI language through the settings). Jaco It is possible. An example is in the SDK resources. There are different scenarios. Scenario 8 shows how to change language on the fly. 来源: https://stackoverflow.com/questions/13743704/change-ui-culture-in-winrt