Q:

Running C# clickonce console app

I have a Command line console app that references a dll 'VMware.Vim.dll', but this has other referenced dll's like VimService41.dll, VimService20.dll etc saved off in the GAC on my local machine.
I want to deploy this exe to any computer and be able to run it by passing arguments. When I copy over the exe and VMware.Vim.dll, it complains about the other missing dll's although they are not part of the release folder.
I tried the Publish option and created a ClickOnce Application to deploy it to the machine I want to execute the exe from. This created a setup.exe and a manifest file. When I run it, it complains that the external dlls have not been added to the GAC. 
How do I run this clickonce console app by passing arguments?

A:

First, you don't run a ClickOnce application by running the EXE. If you're going to do that, just xcopy the bin folder from your build over to the machine. You're wasting your life using ClickOnce if you don't need to do automatic updates.
Second, you can try tracking down all of the dll's that you need and including them in the project. This includes all of the secondary or tertiary dependencies. Add them to your project, set the build action to "content", and set "copy to output directory" to "copy always". Then they will be included in the output directory when you build.
Some applications' dll's will work when deployed locally (like DirectX) and some won't (SQLServer Express). You'll just have to try it and see if these do.
I would say, however, that using VMWare assemblies probably is against the EULA. That's like trying to include Office assemblies in order to run Excel on a machine w/o it installed.
As for passing arguments, if you really DO want to use it as a ClickOnce application, here is a blog entry explaining how to pass arguments to an offline (or online) ClickOnce application:
http://robindotnet.wordpress.com/2010/03/21/how-to-pass-arguments-to-an-offline-clickonce-application/

