How do I change exception message to English in Visual Studio??

superm1a3 2008-02-03 02:14:29
Hi all,

My OS is Window XP Chinese version. I installed Visual Studio English version. When I am debugging, the exception explanation message shown is in Chinese. For example, I get "试图除以零" instead of "attempt to divide by zero". This happens both in the IDE and the browers (when debugging ASP.NET). So how do I change the message back in English?

Thanks.
...全文
245 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
superm1a3 2008-02-05
  • 打赏
  • 举报
回复
Thank you for your time and efforts guys.

The right answer is to change the value of the following:
Thread.CurrentThread.CurrentCulture
Thread.CurrentThread.CurrentUICulture

An alternative is to uninstall .net framework language pack (I didn't try it, but it makes perfect sense)

It doesn't work by changing the settings in "Regional and Language Options", since I tried that before I publish this post.

For those who are not used to read posts in English, my apologies. ^_^
wangchao1982 2008-02-03
  • 打赏
  • 举报
回复
Sorry, the 1th lift's is right not 4ht's
wangchao1982 2008-02-03
  • 打赏
  • 举报
回复
This problem is about Thread culture.
So the 4th lift's answer is right.
but you should remember that we should not only change "CurrentCulture" but also change "CurrentUICulture",just like the flowing codes

Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-us");

At last, you should remember to resume the Thread culture. Or other problem will be happen
一品梅 2008-02-03
  • 打赏
  • 举报
回复
客户机请求时,就可以将其机器上的环境变量传递,然后在服务器端根据参数判定.
一品梅 2008-02-03
  • 打赏
  • 举报
回复
宗旨就是改变语言环境变量.
6楼正解,如果需要根据不同区域显示不同语言,只能用 6楼的方法,动态改变文化环境变量.
cat_hsfz 2008-02-03
  • 打赏
  • 举报
回复
最简单的做法,就是把系统的区域设置为en-US,同时也把浏览器的区域设置为en-US。
octverve 2008-02-03
  • 打赏
  • 举报
回复
鹰文,呵呵,如果楼主用中文上百度找一下,早出来了~
lovexin 2008-02-03
  • 打赏
  • 举报
回复
happy happy

欢迎大伙来C# / .Net 7729746 交流社团 聊技术,项目合作。

Blogs http://zhoufleru.cnblogs.com
lovehongyun 2008-02-03
  • 打赏
  • 举报
回复
Regional and Language Options
LikeCode 2008-02-03
  • 打赏
  • 举报
回复
try
start>control panel>regional and language options>the first tab>select an item to match....>english
and select united states for location option
jimu8130 2008-02-03
  • 打赏
  • 举报
回复
直接控制操作系统的区域选项就可以了,需要那么复杂的东西么?
xuan.ye 2008-02-03
  • 打赏
  • 举报
回复
代码控制的话可以用global
void Application_BeginRequest(Object sender, EventArgs e)
{
try
{

// Default to English if there are no user languages
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");

Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
}
catch
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
}
}
xuan.ye 2008-02-03
  • 打赏
  • 举报
回复
void Application_BeginRequest(Object sender, EventArgs e)
{
try
{

// Default to English if there are no user languages
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");

Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
}
catch
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
}
}
amandag 2008-02-03
  • 打赏
  • 举报
回复
同楼上,一般只需要改区域选项即可
saucer 2008-02-03
  • 打赏
  • 举报
回复
楼主是要显示英文,不是中文

试着改动 Control Panel -> Regional and Language Options 里的语言
winner2050 2008-02-03
  • 打赏
  • 举报
回复
An Zhuang Zhong Wen Bu Ding Bu Jiu De Le Ma!

Gao Na Mo Duo Gao Ke Ji Lang Fei Shi Jian。
lextm 2008-02-03
  • 打赏
  • 举报
回复
修改OS的区域还是最简单的方法?那还不如重装一个英文的OS。

检查控制面板“添加或删除软件”,删除.NET Framework的中文语言包。一般来说问题就解决了。

幸亏你用的XP,要是Vista的话,还不知道中文语言包怎么卸载呢。
真相重于对错 2008-02-03
  • 打赏
  • 举报
回复
try
Thread.CurrentThread.CurrentUICulture
jayfushuai 2008-02-03
  • 打赏
  • 举报
回复
我特不明白楼主的做法
你说什么英文啊
你用中文问问题,早给你解决了,别人进了你的帖子,理解题意理解了半天
受不了..

LutzMark 2008-02-03
  • 打赏
  • 举报
回复
jf
o(∩_∩)o...

62,262

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧