.NET Framework SDK project: Launch arguments duplicated for x64 platform

1 week ago 8
ARTICLE AD BOX

I'm working on a C# .NET Framework 4.8 SDK-style project (WPF, Sdk=Microsoft.NET.Sdk).

I want to pass command-line arguments to my project when running from Visual Studio. I created a launchSettings.json like this:

{ "profiles": { "启动": { "commandName": "Project", "commandLineArgs": "sstd --factory" } } }

When I run the project in AnyCPU configuration, the arguments received in Main(string[] args) are correct:

args = ["sstd", "--factory"]

enter image description here

However, when I switch to x64 configuration, the arguments are duplicated:

args = ["sstd", "--factory", "sstd", "--factory"]

enter image description here

Interesting observation

When I clone the same SDK-style project into a different folder, it works normally:

x64 and AnyCPU only receive sstd --factory

No duplicates

This suggests it’s something related to cached settings in the original solution/folder.

I tried deleting all the cache directories such as .vs, .bin, and .obj, but it didn't work.

Read Entire Article