顽固的 Silverlight 缓存问题?

发布于 2024-12-26 03:19:15 字数 522 浏览 2 评论 0原文

在直接跳到正常的缓存修复解决方案之前,请耐心等待。发生的事情是这样的:

我有一个项目,我们解决方案中的数十个项目中的一个项目,在我构建和运行时似乎拒绝更新其代码。它不是 xap 的一部分,而是位于 xap 旁边的一个 dll。

我已经确定不是解决方案的事情:

  • 我检查了其 dll 的输出,并且它已经构建,并且其内容已更新以匹配我的代码,并使用 dotPeek 进行验证。但它拒绝显示更新后的代码。
  • 我清理、重建解决方案并重新启动开发服务器,但它拒绝显示更新的代码。
  • 我切换到不同的浏览器,没有骰子。
  • 我清除浏览器缓存没有用。
  • 我完全删除了本地代码,并从我们的存储库中重新获取,同样,Silverlight 也不喜欢。

不过,我也并非没有取得一点成功。我被扔掉的一根骨头是在周末。几天没有碰它,周一我回到工作岗位,没有对它做任何事情,它就更新了。然而现在,它又被缓存了,或者什么的,因为它停留在我对其所做的最后一组更改中。

所以我的问题是:我错过了什么?

Bear with a bit me before jumping straight to the normal caching fix solutions. Here's what happening:

I have a project, a single project out of dozens in our solution that appears to be refusing to update its code when I build and run. It's not part of the xap, but a dll sitting along side the xap.

Things I've already determined not a solution:

  • I've checked the output of its dll and it has been built, and its contents updated to match my code, verified with dotPeek. But it refuses to display the updated code.
  • I clean, rebuild the solution, and restart the dev server but it refuses to display the updated code.
  • I switch to a different browser, no dice.
  • I clear browser cache's to no avail.
  • I completely delete my local code and do a fresh fetch from our repository, again, no love from silverlight.

I have not been without a little success though. The ONE bone I've been thrown was over the weekend. Not touching it for a couple days, I came back to work on Monday and, without having done anything to it, it just updated. Now, however, it's cached again, or something, because it's stuck in the last set of changes I made to it.

So my question is this: What am I missing?

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

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

发布评论

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

评论(3

醉生梦死 2025-01-02 03:19:15

您的文件很可能是只读的,并且 MS Build 无法显示错误消息并且不更新文件。如果您错误地签入了 .xap 文件,那么这是可能的,您必须将其从源代码管理中删除,并通过删除只读复选框使 .xap 文件可写。

Visual Studio 错误地签入您的 .xap 文件,并且 silverlight 构建不会报告任何错误。

其次,您是否安装了任何其他文件备份服务,例如 Shadow copy 或 Dropbox 类型的在线备份服务,某些东西可能会使 xap 文件只读,从而导致此问题。

Most likely your files may be read only and MS Build fails to display error message and it does not update files. In case if you have mistakenly checked in your .xap files, then this is possible, you will have to remove it from your source control and also make .xap file writable by removing readonly checkbox.

Visual Studio checks in your .xap files by mistake and silverlight build does not report any error.

Second, do you have any other file backup service installed like Shadow copy or Dropbox kind of online backup service, something is probably making xap files readonly and that is causing this problem.

恏ㄋ傷疤忘ㄋ疼 2025-01-02 03:19:15

这里有几个答案:防止 Silverlight 3 在调试时进行缓存< br>
下面的代码帮助了我(将其添加到托管应用程序的页面的 Page_Load 中):

Response.Cache.SetExpires(DateTime.Now.AddSeconds(-100));
Response.Cache.SetCacheability(HttpCacheability.NoCache);

更新:
防止 Silverlight xap 被代理服务器缓存

Here there are couple answers: Prevent Silverlight 3 from caching while debugging
Code below helped me(add this to Page_Load of page that hosted the app ):

Response.Cache.SetExpires(DateTime.Now.AddSeconds(-100));
Response.Cache.SetCacheability(HttpCacheability.NoCache);

UPDATE:
Prevent Silverlight xap from being cached by proxy server

北笙凉宸 2025-01-02 03:19:15

“所以我的问题是:我错过了什么?”

我们的应用程序使用的内部缓存机制。所以,你们中没有人能真正帮助我,因为这是我们软件的架构功能。

"So my question is this: What am I missing?"

An internal caching mechanism that our application uses. So, none of you could really have helped me as it was an architectural feature of our software.

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