How do I set the command line arguments for an application I am developing using Visual Studio , it is a console application. I've done this on eclipse, is there a similar option on Visual Studio?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Something must be wrong with your Visual Studio if you don't see Command Line Arguments
.
If you can't fix your Visual Studio, there is an option to add StartArguments
element to your .csproj.user
file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartArguments>Argument1 Argument2</StartArguments> <<== THIS LINE
</PropertyGroup>
</Project>
回答2:
I would like just to add that menu shown on the picture could be accessed via Visual Studio 2010 Project Menu, then all the way down to the your project name properties.