Reputation: 397
I'm new to using click once when publishing my applications, I've managed to get my application published. However, when I launch the application as a user I'm finding that the app settings file has not been pulled from the server to the user's device. This results in the application falling over on startup.
My question is how when publishing via Click once can I ensure that an app settings Json is copied to the user's machine?
I'm using .net core 3.1 for my application with Microsoft Visual Studio Community 2019 Version 16.8.3 for my IDE for complete context.
Upvotes: 6
Views: 2031
Reputation: 125277
After adding appsettings.json (or any content file) make sure you set the build action to Content and set Copy to output directory to Copy Always (or copy if newer):
Then it will be automatically included as part of the deployment files. To make sure the file will be included in the deployment files, in the ClickOnce setup, in settings step, click on Application files and make sure the publish status is Include (Auto):
Upvotes: 11