开发者

clickonce file missing

Using Clickonce with VS 2010 and .NET framework Client profile 3.5, I have several file folders with application level XML and/or textfiles that 开发者_如何学编程are needed at runtime.

The file folders sits in the same project where they are to be used.

These files are marked as "Copy always" at compile. Build Action is "Content".

On my development machine the files are actually copied into the ./Bin/Release/myFileFolder/xxxxx and all is fine.

On user's computer, install runs fine but some files are reported missing at runtime when the program need them.

Do I miss something? Is any file specific option deep hidden in the option list?

Help please! and .NET framework 3.5


If the files are in referenced projects then they are not included in the click once publish by Visual Studio. You can verify this by checking the application files dialog in the publish page of the project properties.

Assuming this is the case to get these files included you can either add them as links in the main project itself or edit the project file to include extra files in the manifest. See ClickOnce Content Files for information on how to do this.


I can confirm that this can still be an issue in Visual Studio 2019.

I have been working on DevExpress dashboards that consume XML files at runtime to produce their dashboard layouts, and whenever I would publish my project, I would get a bizarre error about the XML file not being found when clearly it was published to the same output directory as the rest of the project.

Just to be clear, the XML file existed in my Visual Studio project and was set to Build Action = Content and Copy Always To Output Directory.

What I had to do was what was suggested in this answer:

  • Go to Project Settings.
  • Open the Application Files list.
  • Change the Publish Status of the XML file - which Visual Studio automatically set to Data File (Auto) - to Include.

Voila. FileNotFound error magically disappeared after publishing the project.


A workaround is to make your application create the xml/txt files if they dont exist.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜