Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent deploying debug build with ClickOnce

I'm publishing a ClickOnce application with VS2008, but before every publish I have to switch to Release config manually. This is fine as far as I don't forget to switch. Is there a way to prevent deploying debug builds ? Is there some compiler directive like:

#if DEBUG
#if ClickOnce
#error You cannot publish a debug build
#endif
#endif

Or is there a way (without build scripts) to automatically switch to Release config before publishing ?

(I've found some similar questions but didn't like the anwsers on them)

Thanks

like image 596
jomi Avatar asked Apr 13 '10 21:04

jomi


People also ask

How do I block ClickOnce?

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.

What does enable ClickOnce security settings do?

You can configure security permissions on the Security page of the Project Designer. The Security page in the Project Designer contains an Enable ClickOnce Security Settings check box. When this check box is selected, security permission requests are added to the deployment manifest for your application.

Does ClickOnce require admin rights?

ClickOnce applications are fundamentally low impact. Applications are completely self-contained & install per-user, meaning no-admin rights are required. You don't have to worry about a ClickOnce application breaking other applications. ClickOnce applications can be deployed via web servers, file servers or CDs.

Is ClickOnce secure?

ClickOnce applications are self-contained; each ClickOnce application is installed to and run from a secure per-user, per-application cache. ClickOnce applications run in the Internet or Intranet security zones. If necessary, the application can request elevated security permissions.


1 Answers

Not sure if this is frowned upon, but please see my answer in the related thread:

https://stackoverflow.com/a/15080048/571237

In short you can modify the project files to check for debug symbols before publishing, and throw an error condition if they're found. This prevents the deploy from happening without needing any .bat files or external processing.

like image 151
Sam Storie Avatar answered Sep 20 '22 06:09

Sam Storie