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

Visual Studio 2022 process devenv.exe not closing #64

Open
darko1979 opened this issue Feb 20, 2023 · 17 comments
Open

Visual Studio 2022 process devenv.exe not closing #64

darko1979 opened this issue Feb 20, 2023 · 17 comments

Comments

@darko1979
Copy link

Because I'm working on multiple projects I often need to switch from projects on svn to projects on git.
I'm having this problem for some time now when I close one project (close Visual Studio) and open another project in new Visual Studio instance, devenv.exe from previous instance is still running. Very often when I notice this I have 3-4 instances running in the background but only one Visual Studio window is actually shown.
I always thought it's Visual Studio's fault but now I managed to reproduce it and I think it has something to do with AnkhSVN extension.

It was always tedious for me to go through options to changed current plugin (Tools -> Options -> Source Control -> Plugin Selection) until I found that there is a dropdown at the bottom right with label "Add to Source Control" where I can change the current plugin with two clicks.

To reproduce this issue do the following.

  1. Open Visual Studio 2022 without a project and go to Tools -> Options -> Source Control -> Plugin Selection and make sure no plugin is selected.
  2. Close Visual Studio
  3. Open a project on svn with Visual Studio 2022 and when it loads click on a button "Add to Source Control" (or click Ctrl+Alt+F9) and choose "AnkhSVN"
  4. Close Visual Studio
  5. Check task manager and you can see that devenv.exe process is still running and not closing but there is not Visual Studio IDE window present

This does not happen if I change the plugin using options menu Tools -> Options -> Source Control -> Plugin Selection -> Select AnkhSVN. Also it does not happen if I use the same method but change to git source control.
Not sure what is the difference between these two methods of changing active source control but the "Add to Source Control" dropdown is causing Visual Studio 2022 not to properly close.

I'm using the latest build for Visual Studio 2022 found here https://github.com/AmpScm/AnkhSVN/actions/runs/3808815322

@BearSleepy
Copy link

BearSleepy commented Jul 10, 2023

@darko1979 If you are still stuck let me know if this is better: https://github.com/FallenWorlds/AnkhSVN

I need to make sure for my purposes this doesn't happen either. If you are already good don't worry about it. I may ask questions later if can't repo. Thanks

@darko1979
Copy link
Author

@darko1979 If you are still stuck let me know if this is better: https://github.com/FallenWorlds/AnkhSVN

I need to make sure for my purposes this doesn't happen either. If you are already good don't worry about it. I may ask questions later if can't repo. Thanks

Just checked your build v3.0 and it has the same issue as the build I referenced in this post. My guess is that something is different about the process how plugin is initialized when you changed it from the options menu or when you use "Add to Source Control" menu, the second method probably does something additionally that AnkhSvn does not handle properly.

Somebody from Microsoft would probably know where to look for a problem. I originally wanted to post this issue in visual studio developer community but the chances of being investigated by Microsoft developers zero, they just don't care about svn support and certainly they do not care about some external plugin.

@BearSleepy
Copy link

BearSleepy commented Jul 11, 2023 via email

@BearSleepy
Copy link

Like this? As a background process?
image
Keep in mind if I could repo it in the AS project, then it will be easier to fix or tell you why cant be fixed because i control the project system and everything in that for dubuging.

I assume if you did the same thing with Git on your end it would not stall in background processes?

@BearSleepy
Copy link

BearSleepy commented Jul 11, 2023

Do you use discord? Do you want to come to the AddOn Studio discord so we don't spam here? Good chance I can fix this, esp if it doesn't happen when you do the same thing but choose Git.

Discord: https://addonstudio.org/wow/support

Can also file a bug on the other project in github additionally if want. And can be documented the resolution good or bad.

@darko1979

@BearSleepy
Copy link

It's ankh, and its directly related to the button.

99% sure can be fixed in Ankh code. Doing it now.

@darko1979
Copy link
Author

darko1979 commented Jul 11, 2023

@BearSleepy yes, devenv.exe can be located in task manager (I personally use sysinternals process explorer), after closing main visual studio window devenv.exe will stay active consuming memory untill I terminate it manually.
As I stated in the first post, with Git this does not happen.
Not using discord that often, I can create the same issue in your project if you allow issues to be posted.

@BearSleepy
Copy link

@darko1979 There's an unfinished task blocking the ssc services closing down. I have it fixed on mine.

Causes the process to do everything it can, like close the message loop, which allows the window to close. But still has to wait on unfinished tasks, incase was doing something important, before closing the process or committing settings.

@BearSleepy
Copy link

BearSleepy commented Jul 12, 2023

@darko1979 Still working on it.

It works, but i wanted to test it all the way, and make the button work more correctly. I spent today hand making a SVN server and have finally gotten a clean 'add solution to repository'. Maybe later today or tomorrow for release

@BearSleepy
Copy link

@darko1979

If I fix this all the way, it will also load the "add solution to SVN" dialog when the button is clicked, as it normally would work. Unless you wanted to actually commit the solution itself, you would just have to close it every time.

Sounds like you have projects already in SVN that were added to an existing solution, or were checked out or committed outside of VS. I say that because I happened have some also and was how I was able to replicate your issue.

If I try commit new projects to SVN from inside VS, it tags the solution no matter what I click, to be "SVN only".

And when I load the solution I get no "add to" button and automatically loads SVN whenever the project loads, AND leaves it set as the current provider. And if I try to change providers it force closes the solution if it do.

I can also try to make a switch providers button.

Let me know before I release this what you think of all this and of course any details on your exact workflow before I end up causing a bigger issue.

Thanks :)

@darko1979
Copy link
Author

darko1979 commented Jul 13, 2023

@BearSleepy
Yes you are right, projects were not added to their repositories from within Visual Studio, and sometimes I do commits inside VS and sometimes I do it from outside. For GIT I prefer always commit/push from outside of VS.

I tried using source control switcher plugin, but mostly they do not work correctly and when Visual Studio 2022 came out they did not work at all. I tried to figure it out how VS binds a solution to a GIT or SVN but could not figure it out.
I use now Visual Studio 2022 for GIT projects, and Visual Studio 2019 for SVN projects so no problem switching between plugins.

I made a gif videos demonstrating the issue.

With GIT no stuck background process:
open git
Not sure why in this example "Create GIT Repository" dialog shows because this projects is already connected and pushed to github. My working projects does not show this dialog when I do the same thing and I do not see anything GIT related in solution (.sln) and project (.csproj) files.

And with SVN visual studio process remains in background:
open svn

@BearSleepy
Copy link

@darko1979

The FW/AnhkSVN 3.0.1 is released: https://github.com/FallenWorlds/AnkhSVN with the fix for process not exiting. Please let me know.

Thanks for all that info. I'm going to try to make it work all the way correctly and try to address the long-standing issue for everyone of not being able to switch, except for the tedious trip into settings. And the issue if allowing to remove stickiness on solution.

I think just how it was without forced stickiness, where one provider just ignored projects it didn't know, is great. You can have projects with different providers. I understand why, as it would in theory make switching automatic. But its way too coarse, and you have 0 chance to add anything in that solution to another provider, without playing the hand-built multi-solution shell game.

@darko1979
Copy link
Author

@BearSleepy I just tried version 3.0.1 and Visual Studio 2022 now terminates properly. You fixed the issue, thanks!

@BearSleepy
Copy link

@darko1979 Sweet I'm glad it worked.

I had only tested on mine, but was pretty sure that was it because of how the code was.

If you dont mind can test a newone later in a few days or so. I want to add the actual popup like its suposed ot have and makeit so the button is actually clickable, rather than having to hit ctrl-alt-f9 to get the list.

I'd also like to deal with the "sticky" situation, as right now you can only add project, get forced sticky even if you say no, then have to make a blank solution and ditch the old solution, etc... I think is same prob witf git or svn.

Thoughts on all of this are aprecaited

@BearSleepy
Copy link

@darko1979 and feel free to make bug reports on the other git, of these things or whatever you have issue with. and can work through them

@BearSleepy
Copy link

@darko1979 On your example above, you said were not sure why...

The reason the Git dialog box shows is because by design, the whole purpose of that button is to "add solution to repo" and to make it sticky. You are avoiding sticky by saying no. As soon as you add solution you also no longer get button.

So that's what all my other babbling is about, where i'm saying if i make the button work all the way, it will also cause AnkhSVN to pop up the dialog, and why i said you would then just have to keep saying no but the button would come.

This is why i proposed maybe making another button that could really switch, but if you dont have the orignal button, VS is goign to make you close your solution.

So that leadsin to if i could somehow make a button to unsticky, and have a button to swtich reguarless, that could offer to unsticky.

@BearSleepy
Copy link

And the final result on my end:

https://twitter.com/AddonStudioWoW/status/1679962262856175624

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

No branches or pull requests

2 participants