【问题标题】:PostBuildEvent error copying config filePostBuildEvent 错误复制配置文件
【发布时间】:2013-02-11 23:00:29
【问题描述】:

我正在尝试构建我的项目并收到此错误:

Error   148 The command "copy "C:\Users\agordon\Documents\Visual Studio 2008\Projects\SubversionRepository\Internal Application\eFormsSystem\eFormsApp\Debug.config" "C:\Users\agordon\Documents\Visual Studio 2008\Projects\SubversionRepository\Internal Application\eFormsSystem\eFormsApp\bin\Debug\eFormsApp.exe.config"
copy "C:\Users\agordon\Documents\Visual Studio 2008\Projects\SubversionRepository\Internal Application\eFormsSystem\eFormsApp\Debug.config" "C:\Users\agordon\Documents\Visual Studio 2008\Projects\SubversionRepository\Internal Application\eFormsSystem\eFormsApp\App.config"" exited with code 1.   C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets    3397    13  eFormsApp

这是编译器为此复制过程生成的代码:

 <Target
        Name="PostBuildEvent"
        Condition=
        "
            '$(PostBuildEvent)'!=''
            and
            (
                '$(RunPostBuildEvent)'!='OnOutputUpdated'
                or
                '$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'
            )
        "
        DependsOnTargets="$(PostBuildEventDependsOn)">

            <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />

    </Target>

错误指向这一行:

<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)

我做错了什么?

【问题讨论】:

  • 手动运行copy 命令会发生什么?
  • 我在命令提示符下试了一下,没有问题,只是问我是否要覆盖文件,我说是
  • 我忘了提到这个解决方案存储在存储库中
  • 文件被标记为只读。

标签: c# .net


【解决方案1】:

对我来说,源配置文件不存在(我有自定义构建配置文件)。一旦我从另一个已知好的配置文件复制了该配置文件并针对我的环境进行了修改,一切都开始工作了。

【讨论】:

    猜你喜欢
    • 2017-09-24
    • 1970-01-01
    • 2017-01-24
    • 1970-01-01
    • 2018-03-13
    • 1970-01-01
    • 1970-01-01
    • 2015-05-11
    • 1970-01-01
    相关资源
    最近更新 更多