ASP.Net无法在PRODUCTION中创建/卷影副本 [英] ASP.Net cannot create/shadow copy in PRODUCTION

查看:200
本文介绍了ASP.Net无法在PRODUCTION中创建/卷影副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近更新了一个相当大的ASP.NET网站(〜第1500位alexa流量排名),以使用在Windows Server 2008 R2上运行的VS2010和.NET 4.0



从那时起,当我们部署新版本的网站时,我们偶尔会注意到这个帖子中出现的错误:
ASP.Net无法创建/影子复制
错误消息是:
无法创建/影子副本'xxxx,Version = 4.0.4301.26898,Culture = neutral,PublicKeyToken = null'当该文件已经存在



但是,与那个帖子不同,错误只发生在我们的生产环境&只有在某些服务器上。



在我们发布新版本的代码之后,我们回收所有的AppPools,错误开始发生。



另一个AppPool回收似乎解决了这个问题,但是我真的想知道我们如何才能首先避免这个问题?

解决方案

我们终于解决了我们的无法创建/复制问题。问题原因是由于我们的AppPool回收和我们的目录副本。它的工作原理如下:


  1. 将主网站复制到:server\directory

  2. 网站池

  3. 将小管理员站点复制到server\otherdirectory

问题是我们的管理站点是主站点的虚拟目录,并使用相同的AppPool。这在.NET 2.0下工作得很好,但是我认为当我们升级到.NET 4.0时,我们可以确定失败。如果我们这样做,似乎运行得很好:


  1. 将主要网站复制到:server\directory

  2. 将小型管理员站点复制到server\otherdirectory

  3. 网站的回收应用程序池


We've recently updated a fairly large ASP.NET website (~1500th alexa traffic ranking) to use VS2010 and .NET 4.0 running on Windows Server 2008 R2

Since then, when we deploy new versions of the site we occasionally noticed the same error in this post: ASP.Net cannot create/shadow copy The error message is: Cannot create/shadow copy 'xxxx, Version=4.0.4301.26898, Culture=neutral, PublicKeyToken=null' when that file already exists

However, unlike in that post, the error is occurring only in our production environments & only on some servers.

After we ship a new version of the code, we recycle all AppPools and the error starts occuring.

A further AppPool recycle seems to fix the issue, however I really want to know how we can avoid this problem in the first place?

解决方案

We've finally solved our 'Cannot create/shadow copy' problems. The problem turned out to be due to the timing of our AppPool recycle & our directory copies. It worked something like this:

  1. copy main website to: server\directory
  2. recycle app pool for website
  3. copy small admin site to server\otherdirectory

The problem was that our admin site was a virtual directory of the main site and used the same AppPool. This worked fine under .NET 2.0, but I think we can pinpoint the failures to when we upgraded to .NET 4.0. Seems to run just fine if we do it this way instead:

  1. copy main website to: server\directory
  2. copy small admin site to server\otherdirectory
  3. recycle app pool for website

这篇关于ASP.Net无法在PRODUCTION中创建/卷影副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆