【问题标题】:ClickOnce cant see files, copied during PostBuild eventClickOnce 看不到文件,在 PostBuild 事件期间复制
【发布时间】:2012-02-22 13:52:42
【问题描述】:

Nuget 包添加 postbuild 事件:

if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8482.1\NativeBinaries\x86\*.*" "$(TargetDir)x86"
if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8482.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"

当我刚编译时它就可以工作。
当我想发布时 - 这些目录(x86,amd64)不会出现在应用程序文件中。我不想复制现有文件,因为 nuget 包将被更新并且现有副本会改变,所以我必须记住我需要重新添加它们。如何通过 clickonce 将这些确切的目录(嵌入的 sqlce 需要正是这样的结构)与文件一起部署,并使该过程不依赖于包版本?

【问题讨论】:

    标签: .net deployment msbuild directory clickonce


    【解决方案1】:

    在这里找到答案: https://stackoverflow.com/a/2514027/47672
    就我而言,代码是:

    <ItemGroup>
        <Content Include="$(TargetDir)x86\*.dll">
          <Link>x86\%(FileName)%(Extension)</Link>
          <Visible>false</Visible>
        </Content>
    </ItemGroup>
    <ItemGroup>
        <Content Include="$(TargetDir)x86\Microsoft.VC90.CRT\*.dll">
          <Link>x86\Microsoft.VC90.CRT\%(FileName)%(Extension)</Link>
          <Visible>false</Visible>
        </Content>
    </ItemGroup>
    

    【讨论】:

      猜你喜欢
      • 2016-04-07
      • 2012-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多