JaneySprings / DotNet.Meteor

A VSCode extension that can run and debug .NET apps (Xamarin, MAUI, Avalonia)
https://marketplace.visualstudio.com/items?itemName=nromanov.dotnet-meteor
MIT License
269 stars 10 forks source link

Custom project configuration #125

Closed kireCC closed 3 weeks ago

kireCC commented 3 weeks ago

I am having issues getting the extension to recognize my custom project configurations. This used to be an issue on c# dev kit as well, but it seems to be resolved as of recent.

From my csproj:

image

Meteor only offers the defaults:

image

I tried specifying my custom config in the launch script, but that only changes the path after the app has been built and Meteor is searching for the bundle to install. In the actual .net build script project configuration is still set to just Debug or Release.

JaneySprings commented 3 weeks ago

Hi, @kireCC ! You can specify custom configuration in the launch.json: image

If you want to build with this configuration, you can also change/create the .vscode/tasks.json file:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "dotnet-meteor.task",
            "target": "Build",
            "problemMatcher": [],
            "label": "dotnet-meteor: Build",
           "args": [
               "-p:Configuration=MyCustomConfig"
            ]
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
kireCC commented 3 weeks ago

Hi @JaneySprings, thank you for the quick reply!

Specifying the configuration using the "configuration" property in the launch.json file still passed just Debug or Release in the "dotnet build" command. But I managed to pass my custom config successfully by modifying the Build task in tasks.json like you suggested.

Many thanks!

JaneySprings commented 3 weeks ago

Yeah, I will try to add all configurations to the "debug" statusbar item menu.