BUG:构建后复制操作会生成损坏的副本 [英] BUG: Post build copy action produces a corrupt copy

查看:74
本文介绍了BUG:构建后复制操作会生成损坏的副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。


我遇到并复制了一个奇怪的错误:


- 我有一个生成.DLL文件的项目。$
-在项目中,我有两个构建后的行动:

    1-将文件复制到另一个目录(库),使用xcopy或copy(两者产生相同的效果)

    -   start copy / y" $(TargetPath)" "D:\ MyName \Documenten \ VisualVisual Bibliotheek \ Library"

    2-打开一个资源管理器窗口,显示文件复制到的目录。

    - 启动资源管理器"D:\ MyName \Documenten \ VisualVisual Bibliotheek \ Library"


- 当VS2017打开文件夹时,我会看到该文件。

- 当我打开一个新的资源管理器实例并打开同一个文件夹时,我看不到该文件。


我已经复制粘贴了浏览器窗口中来回查找文件夹名称,结果如上所述。

我可以在文件夹中文件的权限中看到没有区别。

当我尝试从文件夹库中复制文件时,我收到一条错误消息:此项目不再存在。 (即使我仍然可以在两个窗口中找到它。)


当我尝试从项目文件夹TO库中复制文件时,(手动而不是通过post build)工作正常。 


有没有人知道这里发生了什么?|

解决方案

您好Scheltens先生,


感谢您在此发布。


>>> 有没有人知道这里发生了什么?



  • Visual Studio 2017的版本是什么?这是最新版本吗?
  • 我没有通过以下步骤重现您的问题,
    you如果与您有所不同?
  • 创建一个新的空白类库项目。
  • 将以下命令行添加到后期构建事件中:

 start copy / y" 

(TARGETPATH)" "D:\ MyName \Documenten \ Visual Basic Bibliotheek \ Library"
start explorer" D:\ MyName \Documenten \ VisualVisual Bibliotheek \ Library"



  • 构建项目,然后打开一个新的Windows资源管理器,将路径切换为"D:\ MyName \Documenten \ Visual Basic Bibliotheek \ Library"检查dll文件。

  结果是我可以在两个Library 文件夹中找到dll文件并复制它。


您是否尝试禁用病毒扫描程序?如果没有,请尝试。






<跨度> <强>


Hi.

I have experienced and reproduced a weird bug:

-I have a project which produces a .DLL file.
-In the project i have two post-build actions:
    1- copy the file to another directory (Library), using xcopy or copy (both produced the same effect)
    - start copy /y "$(TargetPath)" "D:\MyName\Documenten\Visual Basic Bibliotheek\Library"
    2- Open an explorer window showing the directory the file is copied to.
    - start explorer "D:\MyName\Documenten\Visual Basic Bibliotheek\Library"

- When VS2017 opens the folder, i see the file.
- When I open a new instance of explorer and open the same folder, i do NOT see the file.

I have copy-pasted the folder name back and forth in the explorer windows, and had the same result as described above.
There is no difference that i can see in the rights attributed to the files in the folder.
When I try to copy the file from the folder Library, I get an error saying: This item is no longer there. (Even though i can still see it in one of the two windows.)

When i try to copy the file from the project folder TO library, (manually instead of via post build) it works normally. 

Does anyone have any clue what's going on here?|

解决方案

Hi Mr Scheltens,

Thanks for posting here.

>>>Does anyone have any clue what's going on here?

  • What is the version of your Visual Studio 2017? Is it the latest verson?
  • I haven`t reproduce your question by below steps, you can if there is a difference with you?
  • Create a new blank Class library project.
  • Add below command line in to the post build event:

start copy /y "


(TargetPath)" "D:\MyName\Documenten\Visual Basic Bibliotheek\Library" start explorer "D:\MyName\Documenten\Visual Basic Bibliotheek\Library"

  • Build the project, then open a new windows explorer, switch the path to "D:\MyName\Documenten\Visual Basic Bibliotheek\Library" to check the dll file.

  The result is that I can find the dll file in both Library folder and copy it.

Have you try to disable Virus scanner? if not, please try it.



这篇关于BUG:构建后复制操作会生成损坏的副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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