-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an option to launch external scripts via launchSettings.json #9357
Comments
Why not do it after the build instead of before debugging? |
@ViIvanov watcher processes never "end" so the build will never finish. |
@sayedihashimi thoughts on this? Have there been any similar requests on the webtools side? |
I don't think we have ever had good support for running external apps along with the project in Visual Studio. We have heard numerous requests for better support for these scenarios. I think this is more important given the rise of Cloud Native app development. I'm adding @DamianEdwards and @bradygaster to see if they have additional comments. |
Adding @javiercn who has prototyped an MSBuild->npm integration solution (https://devblogs.microsoft.com/dotnet/build-client-web-assets-for-your-razor-class-library/) in this space. One thing to consider is that launchSettings.json isn't just for VS, but aspects of it are read by and supported by We basically have these integration points today:
Integrating watcher-type build toolchains is a bit more complicated as others have pointed out and generally speaking is difficult in modalities that don't have an obvious session semantic in their use, e.g. Generally speaking, I think that MSBuild is the right integration point for kicking of anything associated with processing project source files into application assets, i.e. "building" the project. All the other user interactions during the inner-loop are higher level than this (VS build/launch/debug, Launch profiles are the integration point for changing aspects of the launch UX itself, e.g. setting environment variables for the launched process, whether to launch a browser or not, the verbosity of messages the launch command displays, the URL/port to launch the application at, etc. If there are scenarios where launching another executable/script is desirable only in the context of launching the project during the developer inner-loop, then extending launch profiles to support that might be useful. |
I also have another user case where this would be useful. We develop a .net plugin that is loaded by an external program. Ideally, we'd have a launch script that:
Then we don't have to overwrite any local files on build and can have a nice debug launcher. I tried:
I don't know how other projects that use .net plugin do this. |
Currently in Visual Studio 2022 there's no way to execute debug tasks/scripts when testing an ASP.NET Core app locally.
It would be beneficial to be able to launch external tools/scripts/watchers in addition to the main application, when debug session is being started (mainly - watchers)
Examples:
In modern front-end almost everything is being BUILT. Tailwind CSS generates a file, TypeScript is compiled to JavaScript etc.etc. To enable live-reload we need file-watchers to launch these builds. And in Visual Studio there's literally no way to run, for example, a simple npm script when I start debugging a web app.
The only thing we have are MSBuild events, but they can't be used to launch long-running tasks (like file watchers) in parallel with debug.
Currently, if you're a front-end dev that makes a lot of changes to CSS/JS, the only way to update the browser is to run
npm run build
every time you make any change in your files. This is painful. Or - stop and restart the app altogether, to re-run all the MSBuild scripts.P.S, Another option would be to offer us a way to hook into Hot Reload events and add custom commands there.
The text was updated successfully, but these errors were encountered: