Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Problems with ClickOnce security in Visual Basic 2008 and passing command line arg
 

Problems with ClickOnce security in Visual Basic 2008 and passing command line arg

Hi,

I have developed a console application in Visual Basic 2008. I try to pass a command line argument like this myapp /date=2008-01-01. The argument will only be passed to the application if the ClickOnce security is unchecked. This works great in debug mode, but as soon as I publish the application, the ClickOnce security is automatic re-checked, and the application refuses to read the command line argument.

Is there a way to allow the command line arguments to be passed on into the application while the clickOnce security is enabled ?

Please help

Thanks,

gsb78

gsb78  Thursday, May 22, 2008 8:26 AM

Two things.

1) ClickOnce is designed for Smart Client deployment, i.e. WinForms and WPF applications. So don't rely on it working for a console application.

2) The only way to do that is to make it an online-only application, and use the arguments in a query string.

http://msdn.microsoft.com/en-us/library/ms172242(VS.80).aspx

RobinS.

GoldMail.com

RobinDotNet  Thursday, May 22, 2008 3:31 PM

Hi,

I have developed a console application in Visual Basic 2008. I try to pass a command line argument like this myapp /date=2008-01-01. The argument will only be passed to the application if the ClickOnce security is unchecked. This works great in debug mode, but as soon as I publish the application, the ClickOnce security is automatic re-checked, and the application refuses to read the command line argument.

Is there a way to allow the command line arguments to be passed on into the application while the clickOnce security is enabled ?

Please help

Thanks,

gsb78

gsb78  Thursday, May 22, 2008 7:54 AM

Two things.

1) ClickOnce is designed for Smart Client deployment, i.e. WinForms and WPF applications. So don't rely on it working for a console application.

2) The only way to do that is to make it an online-only application, and use the arguments in a query string.

http://msdn.microsoft.com/en-us/library/ms172242(VS.80).aspx

RobinS.

GoldMail.com

RobinDotNet  Thursday, May 22, 2008 3:31 PM

Okay, I see.

Is there a way to disable the clickonce security, since I dont really need it?

There must be som way to pass arguments to a console app.

Thanks,

gsb78

gsb78  Thursday, May 22, 2008 3:42 PM

No, you can't. That's the point of ClickOnce. Use a setup & deployment package instead.

RobinS.

GoldMail.com

RobinDotNet  Thursday, May 22, 2008 7:27 PM

You posted this twice, so check the other posting for the responses.

RobinS.

RobinDotNet  Thursday, May 22, 2008 8:11 PM

You can use google to search for other answers

Custom Search

More Threads

• how to run a .net2005 application from sql job
• ClickOnced app exe path always the same (after updates)?
• running 2 .msi's at the same time.
• How to change language in a setup project?
• Problem (with manifest) using COM isolation within a ClickOnce Application
• MSP and installation parameters
• Run ClickOnce deployed app under "administrator"
• Problem with Authenticode
• Problem in Deploying .NET assembly into Server !
• Smart Client Installation Problem