c# - Resource file is not working properly on IIS
问题描述
I have 2 resource file.. one is default for english and another one is for chinese. The web app is working fine with VS but when I published it on IIS its not showing chinese language. I tried other solutions available on stackoverflow but nothing seems to work yet. I can find resources.dll inside zh(bin) folder on IIS. Is the error because of there was only one designer file generated that is Resource.designer.cs or something else. I have made the required changes in Resource File properties like making the class public and build action. IN web.config I changed
<globalization enableClientBasedCulture="true" uiCulture="en-US" culture="en-US" />
from false to true. Please ask if Any other information needed to solve this issue. Please give me some advice on this.
解决方案
当我一开始发布它时,App_GlobalResources 没有被复制到服务器上。我能够在服务器上的 bin 文件夹中看到 chiese 的资源 dll,但我认为它没有用。经过一些更改后在我的服务器上重新发布网站,得到了我想要的结果。这是我更改的内容-我转到资源文件的属性并更改了-
构建到 - 内容
复制到输出目录 - 始终复制
自定义工具 - PublicGlobalResourceProxyGenerator(将两个资源文件都公开)
然后在 web.config 我改变了
<globalization enableClientBasedCulture="false" uiCulture="en-US" culture="en-US" />
至
<globalization enableClientBasedCulture="true" uiCulture="en-US" culture="en-US" />
然后我发布了它并让中文选项正常工作。
推荐阅读
- c# - 不同对的序列(简单的算法问题)
- python - Pandas 删除具有双重条件的重复项
- matlab - Matlab:在实现超类中声明为抽象的方法时,为什么访问必须是公共的?
- java - ExecutorService vs CompletableFuture
- r - 使用带有“knn”方法的 Caret 包时出错——出了点问题;缺少所有准确度指标值
- sql - 从插入的表中为不为空的列选择记录,并且仅当另一列为 Y 时列不为空
- swift - .DAE 或 .SCN 文件在 Xcode 中无法正确显示
- php - 在android中读取mysql数据库返回空值
- django - 链接外键反向查找的每个项目组
- ruby-on-rails - 保存期间 Flash 未呈现模型错误