0

I'm trying to figure out how to pass parameters into a C# .Net Core project. For instance I need to pass a string representing the environment name in and have the code automatically select a file share path based on the value of this parameter.

I know in a Java/Maven project you can pass arguments in through a Maven config and load them through the pom.xml, but I'm not quite sure how to do this in C#. I'm planning on running this on an Azure-Devops build agent and need a way to pass these values in at runtime instead of hardcoding them.

Thanks

BlueRacoon
  • 11
  • 1
  • I think you are looking for configuration file. See https://learn.microsoft.com/fr-fr/aspnet/core/fundamentals/configuration/ – Kalten Aug 28 '20 at 21:57
  • 1
    See possibly also https://stackoverflow.com/questions/58416530/passing-command-line-arguments-to-wpf-core-3-0-sideloaded-application. Frankly, it is not clear in your question what difficulty you have run into dealing with command line arguments. If the duplicate does not solve your problem, please improve the question so that it includes a [mcve] along with a detailed explanation of what that code does, what you want it to do instead, and what _specifically_ you need help with. – Peter Duniho Aug 28 '20 at 21:59

0 Answers0