microsoft / vs-dapr

View, manage, and diagnose Dapr services within Visual Studio.
https://dapr.io
MIT License
21 stars 2 forks source link

Multiple run profiles #15

Closed eduards-vavere closed 3 months ago

eduards-vavere commented 6 months ago

I will have 10+ services in my solution. So far I have only option to add ALL of them to the dapr.yml and run ALL of them?

To use this would need some kind of profile switching or run config switching :)

Great work on this extension, for single project it works :)

philliphoff commented 6 months ago

@eduards-vavere Dapr will always start all applications in the run file; that's a runtime feature request. If you don't want certain applications to run in certain situations, you'll need to create multiple run files and VS supports that.

That said, you can control which of those applications that VS attaches the debugger to, either by explicitly configuring the applications to include or exclude.

You do either of those things using the same launch.json configuration file as you would in VS Code. Each of the configurations then show up as debug launch profiles in VS which you can then select from.

philliphoff commented 6 months ago

There's also an option using .NET Aspire, where you use its host application instead of a Dapr run file to programmatically decide which applications to start say, based on configuration in the selected launch settings file. (That also provides an opportunity to start application dependencies like DBs along with the application, which Dapr run files do not support today.)

Use whichever approach works best for your application.

philliphoff commented 3 months ago

(Closing as there are several options.)