ASP.Net无法在PRODUCTION中创建/卷影副本 [英] ASP.Net cannot create/shadow copy in PRODUCTION
问题描述
从那时起,当我们部署新版本的网站时,我们偶尔会注意到这个帖子中出现的错误:
ASP.Net无法创建/影子复制
错误消息是:
无法创建/影子副本'xxxx,Version = 4.0.4301.26898,Culture = neutral,PublicKeyToken = null'当该文件已经存在
但是,与那个帖子不同,错误只发生在我们的生产环境&只有在某些服务器上。
在我们发布新版本的代码之后,我们回收所有的AppPools,错误开始发生。
另一个AppPool回收似乎解决了这个问题,但是我真的想知道我们如何才能首先避免这个问题?
我们终于解决了我们的无法创建/复制问题。问题原因是由于我们的AppPool回收和我们的目录副本。它的工作原理如下:
- 将主网站复制到:server\directory
- 网站池
- 将小管理员站点复制到server\otherdirectory
问题是我们的管理站点是主站点的虚拟目录,并使用相同的AppPool。这在.NET 2.0下工作得很好,但是我认为当我们升级到.NET 4.0时,我们可以确定失败。如果我们这样做,似乎运行得很好:
- 将主要网站复制到:server\directory
- 将小型管理员站点复制到server\otherdirectory
- 网站的回收应用程序池
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:
- copy main website to: server\directory
- recycle app pool for website
- 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:
- copy main website to: server\directory
- copy small admin site to server\otherdirectory
- recycle app pool for website
这篇关于ASP.Net无法在PRODUCTION中创建/卷影副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!