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

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

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

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


当前回答

在我的例子中,问题是visual Studio 2019上的视觉微。它正在抱怨\_vm\compile.vmps.xml文件。可能无法删除/修改。我通过删除项目根目录中的_vm文件夹并重新构建解决方案来修复这个问题。

其他回答

我也有同样的问题。我是这样决定的:

打开“任务管理器” 结束任务“Explorer.exe” 点击“文件”——>创建新任务——在“explorer.exe”中输入——> 清洁我的项目,它工作

我也有同样的问题。重新开始对我没用。在任务管理器中运行着一个名为VBSCompiler的进程。我必须结束这个过程来修复这个错误。

其他人已经确定此错误是由于另一个应用程序对该文件进行了锁定。只是想指出git diff锁文件以及直到你退出它。这就是我患病的原因。

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之前”)

Sometimes when you double click on a warning about the referenced assembly version mismatch between two or more projects you forget to close the assembly view window and it stays there among other tabs... so you end up with the assembly being locked by VS itself and it took me quite a lot of time to figure that out :) Be careful with the power VS provides ;) Another dummy scenario. Sometimes simply deleting the whole obj folder or just the file warned as the locked one helps out with this crappy error.