The upgrade part turns out to be central here. Most likely, just switching to the modern .csproj
format is enough to trigger this weirdness.
Visual Studio now keeps things like application arguments in Properties\launchSettings.json
, e.g.:
{
"profiles": {
"MyProgram": {
"commandName": "Project",
"commandLineArgs": "bar"
}
}
}
Before the upgrade, that information lived in MyProject.csproj.user
:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>foo</StartArguments>
</PropertyGroup>
</Project>
Visual Studio apparently reads both files when starting debugging; it's not clear whether this is intentional or just a bug. (It would've made sense if the .NET Upgrade Assistant had simply moved that information, from old place to new.
Solution
I deleted the .csproj.user
file, though removing the StartArguments
tag will surely work too. Don't forget to restart Visual Studio!
StartArguments
value exists. github.com/dotnet/project-system/pull/9074. Hopefully that will help avoid this confusion. – Venation