Skip to content
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

Send Commands for Web Projects / Specific Instance #3

Open
TheyCallMeZ opened this issue Feb 21, 2020 · 7 comments
Open

Send Commands for Web Projects / Specific Instance #3

TheyCallMeZ opened this issue Feb 21, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@TheyCallMeZ
Copy link

Thanks for the great StreamDeck Plugin!

I have found when I am running web projects that I have to have focus on Visual studio for the buttons to work. I have tried with running both stream deck and vs 2019 as admin and not as admin.

On a side note there are also rare occasions where I have multiple visual studio instances running apps at the same time. API / Web App testing so having some way to select an instance of studio would be awesome as well.

@nicollasricas
Copy link
Owner

If you have multiple instances opened the command will be sent to the focused instance.

In a case where you are debugging an application if you focus the child application, it will detect the correct instance and sent the command to that instance.

Unfortunately, I couldn't figure out a way to make this work with web/API applications, because there's a middleware between the debug/start as described here (#2).

I just had another idea that may solve this issue. I will give a try in the next days, keeping this open for now.

@nicollasricas nicollasricas self-assigned this Feb 21, 2020
@nicollasricas nicollasricas added the enhancement New feature or request label Feb 21, 2020
@TheyCallMeZ
Copy link
Author

Not sure how you are tracking child instances of applications, but the thing with web applications is that VS will (typically) load IIS Express and whichever browser you have configured. There is also the possibility in the case of .net core there is a non-iis express server running. I believe in this instance it kicks off an exe with the name of your assembly. Let me know if there's anything I can do to help with this enhancement.

@nicollasricas
Copy link
Owner

nicollasricas commented Feb 25, 2020

I track using foreground process ID.

The problem is that IIS being a web server it doesn't track/share information about the process (opened page on debugging). It shouldn't anyway, that's not the purpose of a webserver.

There's no way I can track this by "normal way". Could you share your use case?

The only way I can think this will be possible is by creating something like BrowserLink.

@TheyCallMeZ
Copy link
Author

Actually, I think the easiest thing would be detect a running session of visual studio and if one isn't bound or there are multiple show a window (if possible) prompting for which instance to use. The Browser itself doesn't matter as it's just reading things from the server, studio is still handling the processing of breakpoints, etc...

@nicollasricas
Copy link
Owner

nicollasricas commented Feb 25, 2020

Without something like a BrowserLink (that inject a javascript into your web app when you run it making communication possible) or a browser extension, there's isn't a way to identify if you are on your web app.

If you press the key on Stream Deck by mistake from a tab that is not your app, it will dispatch the command anyway which could break the use case.

Prompting a window won't be ideal, but it's possible.

The problem resides on identifying if you are or not on your app and only dispatch commands when you are.

What happens when you have multiple instances of Visual Studio and need to switch the bound instance?

What happens if you have more than one tab opened in your web app? It should dispatch commands from all or the one started by the debug?

What are you trying to do? Could you please describe it? It will be easier to understand and come with a solution.

@TheyCallMeZ
Copy link
Author

typically I have a browser window open that I am debugging and want to be able to step through without having to move my mouse between monitors. In some cases I will be using a combination of the browser developer tools and visual studio tools at any given break point. In some instances I would be looking at the browser stuff and not want to flip over to visual studio to continue running and I don't always get the tag in my browser that says "Paused in visual studio" which is why when I saw this plugin I thought I'd give it a whirl.

@TheyCallMeZ
Copy link
Author

What happens when you have multiple instances of Visual Studio and need to switch the bound instance?

rarely do I have multiple instances open but it would be whichever is currently running in debug. If there are multiple running debug sessions at that point I would hope for a option to switch but this is the least of my concerns and mostly an edge case.

What happens if you have more than one tab opened in your web app? It should dispatch commands from all or the one started by the debug?

there would not be multiple tabs in that browser unless popups occurred for whatever reason, in which case it would still be the one that spawned from the debug session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants