Project Loading/Unloading
I don't have enough data on this, but what I have is freaky enough that I've started into studying it, and figured I'd ask on here in case somebody has an explanation.
I have a project in VS2022. If I start VS, then load the project by finding it in the recent project list, or by using Open Project, then all is well. If I right click on VS in the task bar and launch the project that way, the project opens, all the recent code pages open up, then the whole project spontaneously unloads and I'm back to an empty VS, ready to load a project.
The first few times that happened, I just figured I might have done something weird, but it's become so consistent that I've started into seeking the patterns for it. Thus I started repeating steps to see what was repeatable. What I have so far is this.
Given project A, B, and T (for target), where A, B, and T are not related to one another, aside from all being projects in VS2022 on the same computer:
Opening T alone is fine.
Opening A alone is fine.
Opening B alone causes B to reload.
If A is open, opening B is fine.
If A is open, opening T causes T to unload.
If A is open, and B is open, opening T is fine.
All of these have been repeated multiple times (yes, I sat here and opened and closed projects repeatedly to make this list), but on the last attempt, with A open, T did manage to remain open, so that is the first violation of the pattern.
Also, while the code pages come up, the unloading happens when the Solution Explorer or Git tabs are populating.
Does anybody know what is going on here?
Re: Project Loading/Unloading
This is new to me, but I wonder if this is a situation where it works fine if you open the solution (.sln file) but causes this wonky behavior if you open the project (.csproj or .vbproj file).
Re: Project Loading/Unloading
I could not replicate the behavior. I am using Azure Devops for source control, not Git.
Microsoft Visual Studio Professional 2022
Version 17.10.6
VisualStudio.17.Release/17.10.6+35201.131
Microsoft .NET Framework
Version 4.8.09032
Re: Project Loading/Unloading
Isn't it still a Git repo? I'm using Azure DevOps, as well, and I can't replicate it on just any project.
Also, as far as I know, I am always opening the .sln. That's the extension shown, anyways. I'm not going to some file system and clicking on a file, though.
1 Attachment(s)
Re: Project Loading/Unloading
Quote:
Originally Posted by
Shaggy Hiker
Isn't it still a Git repo? I'm using Azure DevOps, as well, and I can't replicate it on just any project.
Also, as far as I know, I am always opening the .sln. That's the extension shown, anyways. I'm not going to some file system and clicking on a file, though.
I'm using TFS. And what I see when opening is a .sln file.
What I see
Attachment 193025
Re: Project Loading/Unloading
Does this happen from the taskbar jump-list?
Re: Project Loading/Unloading
Yes. What an interesting question. I hadn't tested that out, but now I have. This issue only happens if I open the solution from the task bar jump list. If I open VS and load a project from there, then it does not happen. I also notice that the load sequence appears different if I load from the task bar versus loading from VS.
Still, why did you ask the question? You must have had some suspicion as to what is going on.
Re: Project Loading/Unloading
I had an issue several years ago where starting from the jump list, Visual Studio sometimes would fail to find projects. Ended up removing those projects from the jump list which seem to resolve the issue.
Re: Project Loading/Unloading
Quote:
Originally Posted by
Shaggy Hiker
Yes. What an interesting question. I hadn't tested that out, but now I have. This issue only happens if I open the solution from the task bar jump list. If I open VS and load a project from there, then it does not happen. I also notice that the load sequence appears different if I load from the task bar versus loading from VS.
Still, why did you ask the question? You must have had some suspicion as to what is going on.
A number of years ago we had someone that had issues with something similar... there was a difference opening sln files in VS vs from explorer ... eventually we discovered it had to do with VS discovering what the CWD is at the time... when opening in VS, it could set the CWD to the location where the sln file is but when opening from Explorer, the CWD was what ever it was, and so it had issues then finding the projects - which are then relative to the sln file. It wouldn't surprise me to find something similar to that going on here.
-tg
Re: Project Loading/Unloading
I figured I'd revive this thread, as something new happened.
I've still been running into the issue described. Fortunately, it's kind of rare since it requires opening two different projects at the same time at work. I open multiple projects at the same time at home quite often, but rarely at work, so the issue is rare.
And today, I spent some time hunting down a data problem using a test project, then opened the production project, moved the relevant code over...and the production project asked me if I wanted to save the changes I had just made, which I did, and then it unloaded.
All this time I was thinking that it would unload as a part of startup, but that's not the case. It fully loads, then unloads itself, but is aware if changes have been made in the few seconds that it was loaded. I don't believe this would be the case if it was the loading process itself that was failing. In that case, it wouldn't think it was loaded and wouldn't notice that the files displayed had changed. Instead, it is fully operational, it just unloads itself. It unloads itself properly, though, asking to save any changes if appropriate.
Does that suggest anything?