Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickOnce not coping data files after Transform #267

Open
LazyLeecher opened this issue Jan 5, 2023 · 0 comments
Open

ClickOnce not coping data files after Transform #267

LazyLeecher opened this issue Jan 5, 2023 · 0 comments

Comments

@LazyLeecher
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant