1

After a .NET Framework console application is published out to a dev server, how do you run the .exe with command line args?

For example, the application is published to \MYSERVER\path\to\published\app

In that directory are the following files after publishing:

  • Application Files (directory with *.deploy files)
  • MyApplication.application (Application Manifest file)
  • publish.htm
  • setup.exe

I have a few basic questions as I'm new to .NET and .NET Framework development

  1. Where is MyApplication.exe?
  2. I can run the application without command line arguments by simply running D:path\to\app>MyApplication.application, when I call that file on the command line with arguments non of them seem to make it into the Main method. For ex: D:path\to\app>MyApplication.application arg1 arg2 arg3 why does the former work but not the latter?
  3. Am I naive in my approach, is there a better way to do this?

I've tried finding the answer here but have been unsuccessful: https://learn.microsoft.com/en-us/visualstudio/deployment/publishing-clickonce-applications?view=vs-2019

HappyDev95
  • 21
  • 3
  • How does your `public static void Main` method look like? – Michael Jan 21 '21 at 20:45
  • 1
    You might want to update your question's title, body, and/or tags to reference ClickOnce, as this is a key bit of context to your question (and not all .NET development uses it). It may improve the quality of answers you receive, as those more familiar with ClickOnce will more easily find this question. – Sean Skelly Jan 21 '21 at 20:52
  • `static void Main(string[] args)` – HappyDev95 Jan 21 '21 at 20:54

0 Answers0