问题描述:

Everyone says thou shalt never add *.csproj.user to TFS for version control. Fine, but what if I want to specify default command line arguments (which get saved in the file mentioned above)?

I poked around the the .csproj file, and the XML looks very similar. So that got me thinking... Can you cut and paste the following XML from the csproj.user file to the end of the csproj file (just above the </Project> tag?

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">

<StartArguments>..\..\DEALS001.ini</StartArguments>

</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">

<StartArguments>..\..\DEALS001.ini</StartArguments>

</PropertyGroup>

网友答案:

Absolutely! This works like a charm.

Do note that subsequent changes to the command line argument from the Visual Studio Project Properties window will create a new csproj.user file that would override (but not remove) the XML you copied to the csproj file.

相关阅读:
Top