I'm using Visual Studio 2013. Now, I have a few C# and C++ projects in a solution. Under project properties I can add some debugging properties. That works fine. But when I run the visual studio solution on another computer the command arguments are deleted.
How can I define default command arguments that are also available when I run the project on another computer?
If you are using other computer for debugging, then instead of setting the arguments in properties, set them via config file.
let's say following is your config file (by-default it is App.config),
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key ="key1" value ="Sample" />
</appSettings>
</configuration>
To get value of key1 use ConfigurationManager.AppSettings["key1"];. You can add multiple keys in <appSettings> tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With