Changes made to an assembly event are not saved when clickonce is published

I'm having problems with the changes made by the post-build event, which is not saved when published.

I currently have my project to add additional information at the end of several static files in post post. When I view the resulting files locally ( <some path>\bin\x86\Debug\), I can verify that the changes have been made.

When I turn to viewing the same files that were published with a mouse click (in the directory <some click once url>\Application Files\<some version>), the files appear without any changes made to them.



In addition to the post build event, I also tried to try the object BeforePublishand get the same result:

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.Targets" />
<Target Name="BeforePublish">
    <!-- build event here -->
</Target>



Can someone explain why I experience this behavior and propose a solution?

+3
source share
1 answer

you need to change the files in the folder objwhere they are copied to the folder publish. In my application, I have the following logic for signing all files for the application:

  <Target Name="SignOutput" AfterTargets="CoreCompile" Condition="'$(ConfigurationName)'=='Release'">
    <PropertyGroup>
      <TimestampServerUrl>http://timestamp.verisign.com/scripts/timestamp.dll</TimestampServerUrl>
      <ApplicationDescription>MY APP</ApplicationDescription>
      <SigningCertificateCriteria></SigningCertificateCriteria>
    </PropertyGroup>
    <ItemGroup>
      <SignableFiles Include="$(ProjectDir)obj\$(ConfigurationName)\$(TargetName)$(TargetExt)" />
    </ItemGroup>
    <Exec Condition=" '$(ConfigurationName)'=='Release'" Command="&quot;c:\Program Files (x86)\Windows Kits\8.0\bin\x64\signtool.exe&quot; sign $(SigningCertificateCriteria) /d &quot;$(ApplicationDescription)&quot; /t &quot;$(TimestampServerUrl)&quot; &quot;%(SignableFiles.Identity)&quot;" />
  </Target>

pay attention to

Include="$(ProjectDir)obj\$(ConfigurationName)\$(TargetName)$(TargetExt)"

line.

+1
source

All Articles