错误 MSB3073:复制 /d“C:\LOANAPP\UX\UserControls\*.css” “C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS””退出并显示代码 1

发布于 2024-11-16 00:40:19 字数 2012 浏览 3 评论 0原文

我们在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

鸠魁 2024-11-23 00:40:19

我目前遇到同样的问题。

在构建解决方案之前删除发布/调试构建目录可以解决一次构建的问题。
之后重建它时,这必须再次完成...

当我找到一个时,我会发布一个真正的解决方案...

编辑:
在进一步调查该问题后,我发现解决方案中出现问题是因为构建后步骤中的复制命令导致了有关是否覆盖现有文件的问题。这在某种程度上产生了这个问题。

我的解决方案是将“/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.

梦旅人picnic 2024-11-23 00:40:19

如果您重命名项目名称或更改输出文件的名称,请在构建后事件中更改它,这可以解决。

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.

傲世九天 2024-11-23 00:40:19

错误 MSB3073:复制 /d "C:\LOANAPP\UX\UserControls*.css" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS" 退出,代码为 1。

构建命令“exits with code 1”,这意味着它失败了。就像您说“复制 *.* f:\lolusux”而您没有可写的 f: 驱动器一样。

解决方案是修复错误。

你说这是什么错误?我不知道。但我知道我该如何去解决这个问题。

  1. 运行构建。在构建输出中,像您​​一样复制构建前/构建后命令,以便将它们粘贴到您的问题中。他们将用实际值填充所有宏,这可能是问题的一部分。
  2. 将其粘贴到记事本中。清理所有的垃圾(即删除非命令文本,例如“error MSB3073:”并保留命令文本,例如“copy /d”C:\ LOANAPP \ UX \ UserControls * .css““C:\ LOANAPP \ UX \ GetQuotations\ThirdPartyOperator\CSS")
  3. 打开命令窗口。浏览到构建失败的项目的输出目录。这是执行这些命令的根目录。
  4. (构建后可选)禁用构建后命令并构建解决方案;这可能需要确保运行后构建命令时文件处于预期状态。
  5. 从记事本复制前/后构建命令的每一行,将它们粘贴到命令窗口中,从头到尾,您将看到命令失败(如果您做的一切正确,如果不正确,请返回)并获取确切的错误消息/失败原因

error MSB3073: copy /d "C:\LOANAPP\UX\UserControls*.css" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS" exited with code 1.

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.

  1. Run the build. In the build output, copy the pre/post build commands as you did in order to paste them into your question. They will have all the macros filled in with actual values, which may be part of the issue.
  2. Paste this into Notepad. Clean all the cruft away (i.e., delete non-command text such as "error MSB3073: " and keep command text like "copy /d "C:\LOANAPP\UX\UserControls*.css" "C:\LOANAPP\UX\GetQuotations\ThirdPartyOperator\CSS")
  3. Open a command window. Browse to the output directory of the project that fails to build. That's the root directory where these commands execute.
  4. (optional for post build) disable post build commands and build the solution; this may be needed to make sure the files are in the expected state when the post build commands run.
  5. Copy each line of the pre/post build commands from notepad, paste them into the command window, and execute them. From first to last, one by one. You will see the command fail (if you did everything right, if not, go back) and get the exact error message/cause of the failure.
  6. Fix the real issue.
小红帽 2024-11-23 00:40:19

以防万一有人发现上述任何方法都无法解决他们的问题,我发现该错误是由路径中名称中带有空格的文件夹引起的。例如:

MyFolder\ThirdParty Test\Blah\MoreFolders\BuildDirectory

...会失败,但

MyFolder\ThirdPartyTest\Blah...

可以毫无问题地工作。如果您需要在路径中包含空格,请将整个目录调用用双引号括起来,例如:

"MyFolder\ThirdParty Test\Blah\MoreFolders\BuildDirectory"

或者仅包含有问题的文件夹:

MyFolder\"ThirdParty Test"\Blah\MoreFolders\BuildDirectory

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:

MyFolder\ThirdParty Test\Blah\MoreFolders\BuildDirectory

...would fail, but

MyFolder\ThirdPartyTest\Blah...

Would work without issue. If you need to have the space in the path, surround the entire directory call in double quotes, like:

"MyFolder\ThirdParty Test\Blah\MoreFolders\BuildDirectory"

Or just the offending folder:

MyFolder\"ThirdParty Test"\Blah\MoreFolders\BuildDirectory
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文