每当我试图复制4个文件到我的bin文件夹,停止主服务后,我得到一个文件(TexteDll)错误。错误是:

Cannot copy TexteDll: The requested operation cannot be performed on a file 
with a user-mapped section open

这可能是由于一些系统锁定。或者另一个进程正在使用这个DLL。当我在谷歌上搜索时,我发现重新启动系统可以解决这个问题。

有人能给出原因或者解决办法吗?我检查了TexteDll的属性(通用、版本、安全性等)。一切都很正常。


当前回答

我尝试了以上的方法,但对我不起作用。我遵循的几个步骤:

关闭所有VS实例,重新打开。 关闭build.exe和explorer.exe进程。 删除项目中的bin文件夹。

对我有用的是—— 重新启动我的机器。

其他回答

以上都没有解决这个问题。

有人在我的解决方案集中有一个项目在构建配置中使用x64 CPU。将其更改为Any CPU会导致构建使用新文件夹。我仍然不知道哪个进程对那个文件有锁。

在我的情况下,删除项目根obj文件夹和重建项目解决了我的问题!

我在用Ant构建Dot Net应用程序时看到了这些错误。

在我的例子中,它是我们公司的备份软件,赛门铁克DLO代理。停止它并排除我的杀毒软件中的目录并关闭Visual Studio似乎有效。

Andrew Cuthbert在2016年指出,git diff也会锁定文件,直到你退出它。

git diff仍然如此,但对于git 2.23(2019年第三季度),对于外部diff工具(正如Burkart在评论中报道的那样),情况将不再如此。

参见Johannes Schindelin (dscho)的commit 3aef54e(2019年7月11日)。 (由Junio C Hamano - gitster -在commit d9beb46中合并,2019年7月25日)

Diff:运行外部Diff前的munmap()文件内容

When running an external diff from, say, a diff tool, it is safe to assume that we want to write the files in question. On Windows, that means that there cannot be any other process holding an open handle to said files, or even just a mapped region. So let's make sure that git diff itself is not holding any open handle to the files in question. In fact, we will just release the file pair right away, as the external diff uses the files we just wrote, so we do not need to hold the file contents in memory anymore. This fixes git-for-windows#1315


运行“git diff”(man),同时允许外部diff处于未合并路径的状态,用于段错误,这已在git 2.30 (Q1 2021)中得到纠正。

参见Jinoh Kang (iamahuman)的commit d668518, commit 2469593(2020年11月6日)。 (由Junio C Hamano - gitster -在commit d5e3532中合并,2020年11月21日)

diff:允许传入NULL到diff_free_filespec_data() 签署人:Jinoh Kang 署名:Junio C Hamano

Commit 3aef54e8b8(“diff: munmap()文件内容在运行外部diff之前”,Git v2.22.1)引入了对run_external_diff中的diff_free_filespec_data的调用,该调用可能传递NULL指针。 通过将diff_free_filespec_data(NULL)设置为no-op来修复此问题并防止将来出现任何此类错误。 修复:3aef54e8b8(“diff: munmap()文件内容在运行外部diff之前”)

我遇到了这个错误,原来问题是FxCop对我的项目运行。我关闭了FxCop,然后我可以再次编译。