MBulli / SmartCommandlineArgs

A Visual Studio Extension which aims to provide a better UI to manage your command line arguments
GNU General Public License v2.0
99 stars 35 forks source link

For an UWP App the parameters are not passed to app #159

Closed DorelPislan closed 1 year ago

DorelPislan commented 1 year ago

If I set them in Visual Studio (Project Properties->Configuration Properties->Debugging -> Command Line Arguments) they are accessible in argument of Application::OnLaunched()entry point.

Irame commented 1 year ago

Yes, sadly UWP and C# projects differ in the way they store the command line arguments. For C# projects there are stored under <StartArguments> in the "*.csproj.user" file, but for UWP apps they are stored under <CommandLineArguments>. This means that we need to distinguish between those two.

As of now I couldn't find a way to do that via the VisualStudio API, because IVsHierarchy.GetProperty with VSHPROPID_TypeGuid only returns the GUID for a normal C# project. The only way I can currently think of, is to read the content of the "*.csproj" file directly and check if the <ProjectTypeGuids> contain A5A43C5B-DE2A-4C0C-9213-0A381AF9435A.

If someone has a better idea I am open for it.