Is there a way to disallow publishing of debug builds with ClickOnce?
I only want to allow release builds through, but right now human error causes a debug build to slip through once in a while.
We're publishing the build from within Visual Studio.
To disable ClickOnce security settings With a project selected in Solution Explorer, on the Project menu, click Properties. Click the Security tab. Clear the Enable ClickOnce Security Settings check box.
ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction.
In Solution Explorer, right-click the application project and click Properties. The Project Designer appears. Click the Publish tab to open the Publish page in the Project Designer, and click the Publish Wizard button. The Publish Wizard appears.
To add a file to a groupClick the Publish tab. Click the Application Files button to open the Application Files dialog box. In the Application Files dialog box, select the Group field for a file that you wish to include in the new group. In the Download Group field, select a group from the drop-down list.
I have started to modify the .csproj files to include the following code to throw an error for debug deploys, effectively preventing the deploy from happening:
<!-- The following makes sure we don’t try to publish a configuration that defines the DEBUG constant --> <Target Name="BeforePublish"> <Error Condition="'$(DebugSymbols)' == 'true'" Text="You attempted to publish a configuration that defines the DEBUG constant!" /> </Target>
Just place it at the end of the file, right before the </Project>
tag.
(original source: http://www.nathanpjones.com/wp/2010/05/preventing-clickonce-publishing-a-debug-configuration/comment-page-1/#comment-625)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With