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

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

问题描述

我开发ASP.Net应用程序时反复出现此错误:

I get this error repeatedly when developing ASP.Net applications:

  Cannot create/shadow copy 'XXXXX' when that file already exists

其中xxxxx是一个随机的DLL。通常情况下,DLL是从微软的企业库的dll的一个,但各不相同。

Where XXXXX is a random DLL. Typically the DLL is one of the DLLs from Microsoft's Enterprise Library, but it varies.

这是真正随机的,这是非常令人沮丧。我会去个小时没有收到错误,然后得到这个错误每次10-20分钟。

It's really random, and it's very frustrating. I will go hours without getting the error, and then get this error every 10-20 minutes.

我见过几种解决方案。例如,<一href=\"http://stackoverflow.com/questions/281145/asp-net-hostingenvironment-shadowcopybinassemblies\">this问题。我已经使用清理解决方案选项尝试过了,我也只是重新启动我的本地IIS。然而,它仍然出现在相同的随机但持久的频率。

I've seen several solutions. For instance, this question. I've tried using Clean Solution option, and I've also simply restarted my local IIS. However, it still occurs at the same random but persistent frequency.

我也看到很多人提用在配置文件中此选项:

I've also seen many people mention using this option in the config file:

<hostingEnvironment shadowCopyBinAssemblies="false" />

不过,其他人提到它是有问题的,它绝对不应在生产中使用。

However, others have mentioned it being problematic, and it should definitely not be used in production.

所以,我应该干脆放弃,并尝试shadowCopyBinAssemblies选项? (并确保没有这种变化复制到其它环境。)我是唯一一个谁得到这个问题,往往?

So, should I just give up and try the shadowCopyBinAssemblies option? (And make sure not to copy this change to other environments.) Am I the only one who gets this issue that often?

注:的我使用Visual Studio 2008。

Note: I am using Visual Studio 2008.

推荐答案

以下解决方法来自<一个href=\"http://www.connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=227522\">this现已解散的连接问题:


  • 添加&LT; hostingEnvironment shadowCopyBinAssemblies =FALSE/&GT; &LT;的System.Web&GT; 部分你的web.config文件。

  • 重新启动卡西尼当你得到这个问题

  • 如果您收到错误,停止调试器,右键单击该解决方案,干净的解决方案。按F5重新启动调试器。这实在是烦人,因为它有> 50%的失败率,我和你会认为那里的不应该是干净的解决方案手动选择!的这$ 1200的POS应用程序会自动清理你!

  • 这是另一个解决办法,可能是更有吸引力一些,加里·法尔的礼貌(<一个href=\"http://blogs.claritycon.com/blogs/gary_farr/archive/2007/03/09/2888.aspx\">http://blogs.claritycon.com/blogs/gary_farr/archive/2007/03/09/2888.aspx).

  • 以下添加到您的pre-生成事件:

  • add <hostingEnvironment shadowCopyBinAssemblies="false" /> to the <system.web> section of your web.config file.
  • Restart Cassini when you get the problem
  • If you get the error, stop the debugger, right click the solution and "clean solution". Hit F5 to restart debugger. This is really annoying as it has >50% fail rate for me and you would think that there should not be a manual option to CLEAN SOLUTION! This $1200 POS application should clean it for you automatically!
  • Here's another workaround that may be more appealing to some, courtesy of Gary Farr (http://blogs.claritycon.com/blogs/gary_farr/archive/2007/03/09/2888.aspx).
  • Add the following to your pre-build events:

(如果存在)$(TARGETPATH​​).LOCKED(德尔$(TARGETPATH​​).LOCKED)ELSE(如果存在的$(TARGETPATH​​)($移动(TARGETPATH​​)$(TARGETPATH​​).LOCKED))

这确实对我的工作是不是用打造的解决方法使用生成解决方案

A workaround that does the job for me is instead of using "Build" use "Build Solution"

编辑:从<一个检索到的项目href=\"http://web.archive.org/web/20101006134513/http://connect.microsoft.com/VisualStudio/feedback/details/227522/cannot-create-shadow-copy-variousfilename-when-that-file-already-exists\">an旧版本的页面(archive.org提供)的。

Items retrieved from an old version of the page (courtesy of archive.org).

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

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