gpt4 book ai didi

visual-studio - 无法在 Visual Studio 中将文件 "*\bin\debug\*.dll"复制到 "bin\*.dll"

转载 作者:行者123 更新时间:2023-12-01 09:10:00 25 4
gpt4 key购买 nike

我遇到了这个问题

Unable to Copy File "*\bin\debug\*.dll" to "bin\*.dll"

而当这种情况发生时,编译会因为上面的错误而失败。

编辑:我知道文件被 devenv.exe 进程锁定,导致上述错误,因为如果我重新启动 VS,那么问题就会消失,但无论如何可以在没有实际的情况下解决这个问题重启VS?

最佳答案

我过去曾遇到过这种情况,正如 Sam 所建议的那样,重新启动 VS 似乎可以工作,尽管不是您想要的。

但是,MSDN 论坛上有一个主题“Unable to copy from obj\debug to bin\debug”,它提供了一些建议:

选项 1

Create a pre-build action in your project by going to project properties (right-click on the project in the solution explorer, and select the Properties option), select the Build Events tab. Add this code:

if exist "$(TargetPath).locked" del "$(TargetPath).locked" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"

This copies the file to a different name, and allows the build to continue successfully.

后续跟进:

But one small improvement is neccessary to let the hack work also if the build is run from scratch, e.g. after clean:

if exist "$(TargetPath).locked" del "$(TargetPath).locked" if not exist "$(TargetPath).locked" if exist "$(TargetPath)" move "$(TargetPath)" "$(TargetPath).locked"

选项 2

I had a similar problem and I solved it excluding from the project in [Source Repository of Choice] the folders bin and obj.

HTH 的

关于visual-studio - 无法在 Visual Studio 中将文件 "*\bin\debug\*.dll"复制到 "bin\*.dll",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2037014/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com