Resx 文件的奇怪 IIS 缓存行为

发布于 2024-08-22 14:18:19 字数 752 浏览 7 评论 0原文

我在使用 .net 2.0 和 IIS 6 的网站上遇到了一些奇怪的问题。该网站使用 resx 文件,因此它已本地化为多种语言。在其中一些文件中,我们对 resx 进行了更改并重新编译,但这些更改不会显示在站点上。曾经。这种情况主要发生在一种语言(阿拉伯语)中,但偶尔也会发生在其他语言中。

我的第一个想法是,这些更改还不足以让 Visual Studio 构建它们,但发布后我可以验证新 resx 文件中的更改。我也可以在服务器上物理确认 resx 中的更改,然后打开网页,但更改不会显示。我认为可能有一台服务器正在缓存它,但在多个互联网连接中它是相同的。

我已经尝试过的

  • 我已经重新启动了 IIS,包括各个站点和整个服务。
  • 我已经重新启动了服务器。
  • 我已经回收了应用程序池。
  • 我已经清除了 .net 文件夹中的所有临时文件。
  • 我已将标头插入到站点中,将其设置为无缓存并验证它
  • 我已插入元标记以指示无缓存
  • 我已删除 resx,访问该站点并收到错误,然后重新上传它。
  • 我极大地改变了 resx 文件的大小,希望它能触发一些东西。
  • 我极大地改变了该字段中的文本量,但没有一个显示出来。
  • 我已经三重检查,确保我在 resx 中请求正确的字段。
  • 我已验证我的虚拟主机未使用任何缓存服务。

由于某种原因,这些改变并没有发生。任何有帮助的想法将不胜感激,这让我和这里其他知识渊博的人完全难住了。

I'm having some strange problems with a site using .net 2.0 and IIS 6. The site uses resx files so it's localized in many languages. In some of those files we make changes to the resx and recompile, and the changes don't show up on the site. Ever. It's primarily in one language (Arabic) that this happens, but occasionally other languages as well.

My first thought was that the changes were not drastic enough for visual studio to build them in, but after publishing I can verify the changes in the new resx files. Also I can go on the server and physically confirm the changes in the resx, and open the webpage and the changes are not showing. I thought there may be a server at work caching it, but it's the same from multiple internet connections.

What I've already tried

  • I have restarted IIS, both the individual sites and the whole service.
  • I have restarted the server.
  • I have recycled the application pool.
  • I have cleared out all the temp files in the .net folder.
  • I have inserted headers into the site setting it to no-cache and verified it
  • I have inserted meta tags to indicate no-cache
  • I have deleted the resx, accessed the site and got the error, then reuploaded it.
  • I have drastically changed the size of the resx file in hopes it would trigger something.
  • I have drastically changed the amount of text in the field, none of which shows up.
  • I have triple checked that I'm asking for the right fields in the resx.
  • I have verified my webhost is not using any caching service.

For some reason the changes just aren't taking. Any ideas an help would be greatly appreciated, this one has me and other knowledgeable folks here completely stumped.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的位置 2024-08-29 14:18:19
  1. 仔细检查已更改文件和临时文件的安全权限。如果网络服务器的帐户无法读取它们,则您的更改将不会显示。

  2. 确保您有“中立”文化资源的条目。如果您的主 resx 文件中没有条目,则编译器将不会发出代码来翻译该特定标签/按钮等。

  3. 强制站点重新编译也是一个好主意(但您已经在上面了) )。有时,我在更改资源文件后所做的就是打开 aspx 页面,然后在末尾添加一个空格,保存并关闭。瞧,它将被重新编译。

  1. Double check the security permissions for the changed files and the temp files. If the web server's account cannot read them, then your changes won't show up.

  2. Ensure you have an entry for the "neutral" culture resource. If you do not have an entry in your main resx file, then the compiler will not emit code to translate that particular Label/Button, etc.

  3. Also forcing the site to recompile is a good idea (but you have that up there). Sometimes what I do after a resource file change is to open the aspx page and just add a space to the end, save and close. Voila it will be recompiled.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文