slow-cheetah icon indicating copy to clipboard operation
slow-cheetah copied to clipboard

ClickOnce not coping data files after Transform

Open LazyLeecher opened this issue 2 years ago • 0 comments

Hi, I have a windows app (.exe) and using clickonce to publish it. The project has a data file "data.xml" with some configurations. When I publish and install, the data file not being copied to the clickonce data folder and so the app can't find it. Before I apply transform to the data file the clickonce was function fine, the file was on clickonce data folder, but after I applied transform to the file the app began to give error of file not found. After I analyze the problem I found this:

  1. The data file is being deployed, there is a file on the publish folder "data.xml.deploy" (is there with and without the transform).

  2. I found a difference in the manisfet file on the publish folder after I apply the transform. For some reason after slow-cheetah apply the transform at the data file the publish is not including the writeableType="applicationData" attribute to the manifest, what I think is the reason the data file not being copied to the data folder on installation.

    A- part of the manifest of the data file without transform

  <file name="DATA.XML" size="1331" writeableType="applicationData">
    <hash>
      <dsig:Transforms>
        <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
      </dsig:Transforms>
      <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
      <dsig:DigestValue>GfHSlnIRmG6c7u/SabK7snYl1WS0fkpvbcesbEOyC6E=</dsig:DigestValue>
    </hash>
  </file>
B- same part with the transform
  <file name="DATA.XML" size="1845">
    <hash>
        <dsig:Transforms>
        <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
      </dsig:Transforms>
      <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
      <dsig:DigestValue>dc54XVOSdTBm5fJifMPFMbMY2DAB8ji+oJzolyZlixA=</dsig:DigestValue>
    </hash>
  </file>
  1. The properties of the data file on VS is: Build Action = Content Copy to Output Folder = Copy Always

  2. The config on the Publish > Application Files is: data.xml Data File Required Include (I set it to Data File and not Auto)

OBS1: I'm applying transform to the app.config file without problems the entire time.

OBS2: Later I remove the transform of the data file and remove the attribute TransformOnBuild from the ItemGroup > Content at the project file, the app works fine with the data.xml on the Data folder.

LazyLeecher avatar Jan 05 '23 22:01 LazyLeecher