错误 MSB3073:复制 /d“C:\LOANAPP\UX\UserControls\*.css” “C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS””退出并显示代码 1
我们在使用 VSS 作为源代码控制的 Web 应用程序解决方案的项目中遇到此错误。该项目在 VS 2005 项目属性页的预构建事件命令行中有一个脚本 - 构建事件如下:
copy /d "$(SolutionDir)UX\UserControls\*.ascx" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\UserControls"
copy /d "$(SolutionDir)UX\UserControls\*.master" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\UserControls"
copy /d "$(SolutionDir)UX\UserControls\*.js" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\Javascript"
copy /d "$(SolutionDir)UX\UserControls\*.css" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\CSS"
给出以下错误:
============== =================================================
C:\LOANAPP\UX\UserControls\dhtmlwindow.css
C:\LOANAPP\UX\UserControls\modal.css
2 file(s) copied.
C:\LOANAPP\UX\UserControls\dhtmlwindow.css
**Access is denied.**
C:\LOANAPP\UX\UserControls\modal.css
**Access is denied.**
0 file(s) copied.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.ascx" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\UserControls"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.ascx" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\UserControls"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.master" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\UserControls"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.js" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\Javascript"
**C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.css" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS" exited with code 1.**
因为这个错误我们整个解决方案构建失败。
谁能帮助我们,以便我们能够继续......
We get this error in a project in a web application solution which has VSS as source control. The project has a script in the pre-build event command line in the VS 2005 Project property page - Build event is as below :
copy /d "$(SolutionDir)UX\UserControls\*.ascx" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\UserControls"
copy /d "$(SolutionDir)UX\UserControls\*.master" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\UserControls"
copy /d "$(SolutionDir)UX\UserControls\*.js" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\Javascript"
copy /d "$(SolutionDir)UX\UserControls\*.css" "$(SolutionDir)UX\GetQuotations\ThirdPartyOperator\CSS"
gives this below error:
=============================================================
C:\LOANAPP\UX\UserControls\dhtmlwindow.css
C:\LOANAPP\UX\UserControls\modal.css
2 file(s) copied.
C:\LOANAPP\UX\UserControls\dhtmlwindow.css
**Access is denied.**
C:\LOANAPP\UX\UserControls\modal.css
**Access is denied.**
0 file(s) copied.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.ascx" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\UserControls"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.ascx" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\UserControls"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.master" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\UserControls"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.js" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\Javascript"
**C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(823,9): error MSB3073: copy /d "C:\LOANAPP\UX\UserControls\*.css" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS" exited with code 1.**
Because of this error we have whole solution build failing.
Could anyone help us out, so that we would be able to proceed with...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我目前遇到同样的问题。
在构建解决方案之前删除发布/调试构建目录可以解决一次构建的问题。
之后重建它时,这必须再次完成...
当我找到一个时,我会发布一个真正的解决方案...
编辑:
在进一步调查该问题后,我发现解决方案中出现问题是因为构建后步骤中的复制命令导致了有关是否覆盖现有文件的问题。这在某种程度上产生了这个问题。
我的解决方案是将“/y”选项添加到您执行的 copy/xcopy 命令中,这样就不会询问这些覆盖问题。
I am currently encountering the same problem.
Deleting the Release/Debug build directory prior to building you solution solves the issue for one build.
When rebuilding it after that, this has to be done again though...
I'll post a real solution when I find one...
Edit:
After investigating the problem some more, I found out that the problem in my solution occured because the copy command in my post-build step resulted in questions about whether or not to overwrite existing files. This somehow generates this problem.
The solution for me was to add the '/y'option to the copy/xcopy command you execute so these overwrite questions won't be asked.
如果您重命名项目名称或更改输出文件的名称,请在构建后事件中更改它,这可以解决。
If you rename the project name or change the name of the output file, change it in the post-build events and this can be solved.
构建命令“exits with code 1”,这意味着它失败了。就像您说“复制 *.* f:\lolusux”而您没有可写的 f: 驱动器一样。
解决方案是修复错误。
你说这是什么错误?我不知道。但我知道我该如何去解决这个问题。
When a pre/post build command "exits with code 1", that means it failed. Just like if you said, "copy *.* f:\lolusux" and you didn't have a writable f: drive.
The solution is to fix the error.
What is the error, you say? I don't know. But I know how I'd go about figuring it out.
以防万一有人发现上述任何方法都无法解决他们的问题,我发现该错误是由路径中名称中带有空格的文件夹引起的。例如:
...会失败,但
可以毫无问题地工作。如果您需要在路径中包含空格,请将整个目录调用用双引号括起来,例如:
或者仅包含有问题的文件夹:
Just in case anyone finds that their problem isn't resolved by any of the above, I found that the error was being caused by folders in the path with spaces in their names. For instance:
...would fail, but
Would work without issue. If you need to have the space in the path, surround the entire directory call in double quotes, like:
Or just the offending folder: