This is a follow-up on the problem reported in this question with this same name.
I am having the same issue in Visual Studio 2022 of objects collapsing after a few seconds or when clicking on another object. The answer provided was changing a setting in CodeMaid, but I have not loaded CodeMaid and am having the same issue.
I have tried multiple variations of checking and unchecking Tools/Options/Projects and Solutions/General options "Track Active Item in Solution Explorer" and "Restore Solution Explorer project hierarchy state on solution load" and nothing works. As I code, I will open Controllers to see the list of methods inside or a data model to view the variables for reference while I am working on other aspects of the code. It is very frustrating to have them close after a few seconds, forcing me to reopen them again, over and over, throughout the day. Any help would be appreciated on this matter.
Update: A Microsoft Solution was posted here. They included a fix in Visual Studio version 17.3.5 supposedly. Update your IDE and the issue should hopefully be resolved.
This seems to be a known issue under investigation as reported in the bug tracker for Visual Studio. Using version 17.3.0 Preview 2.0 I too have observed this buggy behavior.
A few other users have mentioned on the same thread they are having the same problem. One user posted steps to reproduce which is similar to what I have tried to reproduce the issue myself:
I expand Blazor project, I expand Pages folder, I lookup and expand a particular .razor file which has a nested .razor.cs file with code, I expand it, see the class node, expand class node, click on a property and usually in this moment, after less than a second or so the branch collapses and the focus in on the razor.cs node.
The ticket says that it "worked-in:Visual Studio 2022 17.0" - perhaps try rolling back to this version if you can. Otherwise, you may have to wait for a fix.
I had the same problem and I think I found the cause and a solution. The problem is the preview tab, which opens automatically on the right side of the tab area when an element is selected in the solution explorer. I unchecked the Preview Tab option under Options->Environment->Tabs and Windows and haven't had any problems since.
greets...
Related
I'm trying to access the project properties but the window appears blank. I've tried web solutions View>Properties Window, f4, right click on project folder>properties, Also tried resetting import/export settings, searching for specific tab
everything results in a blank window.. Any help is appreciated!
Thanks in advance.
I ran into this same problem with VS 2022 v17.4.0 Preview 1.0 in a C# Windows forms app. Closing and opening the solution/VS didn't have any effect.
After I closed all the open tabs and reopened a file, the Properties pane was populating correctly.
Does your toolbox items also appear 'greyed out'?
Try Going to your Build Menu and select
Clean Solution
(and perhaps Rebuild afterward - or not)
This happens constantly on my install. I simply minimize the entire VS window, then restore it. Poof! My properties appear. Trivial, but painful.
1 Make sure that your build program is not running (use task manager to end that process if needed) and make sure that you can rebuild your project without errors.
2 Restart Visual Studio as an Administrator.
Good Luck For You All ^_^
I have just encountered this error and it was simply solved by closing the visual studio and reopening it again. it is just gone.
Question is similar to this one except that I see nothing in the Live Visual Tree window (for a solution that worked recently). Another post suggested checking "Enable native code debugging" in the project debug settings. I've tried that to no avail.
More Suggestions?
For some reason, I can't set a breakpoint in #functions when using Visual Studio 2013. Here's an example:
However, the same kind of breakpoint works in Visual Studio 2012:
If you move the #functions block up to the top of the razor page in VS2013 you can set a breakpoint in #functions once again.
You cannot set a breakpoint in #functions if the block is somewhere in the HTML.
Anyone know why? Maybe a bug? This is a big inconvenience if you're migrating an web app from MVC4 or earlier where #function blocks appear in the HTML.
This seems like a known issue. See reported bug in MS Connect.
Description:
"After my upgrade to VS 2013, I am no longer able to debug javascript within MVC razor files. "
http://connect.microsoft.com/VisualStudio/feedback/details/807088/unable-to-debug-javascript-from-the-vs-2013-ide-unable-to-set-breakpoint
I had all of the same issues with "This not a valid location for a breakpoint", and I also had no code highlighting or intellisense on any of the Razor code. None of the solutions I could find resolved it. Primarily because my issue was due to a really dumb oversight on my part, but just in case anyone finds themselves here and have made the same mistake, I thought I'd share it.
If you did not physically create the view yourself in Visual Studio, like if it was created with a NuGet package (Umbraco in my case), or if you opened an existing solution that isn't yours...The view may not be included in the project. You may see something like this
Notice that the Homepage.cshtml file is in there and I can edit it, compile it, render it etc. But I could not insert a breakpoint anywhere. Right clicking on the file and Selecting "Include In Project" was the fix for me.
What worked for me was Excluding the file then Including it again. Picked up the Breakpoints straight away.
Hope it helps!
What helped me overcome this issue was enabling the "ASP.NET" option in the project-properties. See the screenshot:
After each build, Visual Studio 2012 switches from the Solution Explorer to the Code Analysis tab, usually with the yellow "No code analysis issues were detected." (Might as well say "TA DA!").
Is there an option to turn off the tab switching (keeping it on Solution Explorer)? [because I can't find it either in Solutions or Options].
Thanks!
VS 2012
The best answer I have found so far is to drag the Code Analysis view's tab away from the Solution explorer. I've docked mine below the Solution explorer and made it about 1 inch high - so I can still see what it is reporting on the rare occasions when I wish to check it, but without losing my Solution Explorer all the time.
It's still unnecessary but a lot less irritating.
Update - VS 2013
In VS 2013 you can now click the Settings option in the Code Analysis view, and disable the Show window when issues are detected option.
Right Click Project --> Properties --> Code Analysis Tab --> Uncheck Enable Code Analysis on Build.
Hope that Helps.
Just found very helpful blog post about your issue Temporarily disable the C# static code analysis for a whole VS instance.
Also I have found way to permanently disable Code Analysis for all VS 2012 instances:
You need to add Windows environment variable with name "DevDivCodeAnalysisRunType" and value "Disabled" (all without quotes). There is helpful post about Windows environment variables How To Add/Edit Environment Variables in Windows 7.
Hope that helps.
Why would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.
When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.
No error messages are reported when the file is opened.
Update:
(To illustrate my problem)
It attempts to load the projects that belong to the solution:
And then results in a bare solution screen
Express Edition is limited to on project per solution. If you have more than that, you will not be able to use the solution file with the express edition of visual studio. You will need to open the projects separately.
The answer is that the projects did load for the solution but the Window to display them was not open or visible. To make it visible, go to the View menu and select Other Windows:
This displays the 4 projects referenced by the solution
Forgive me for blurring the project names but this might be commercially sensitive and therefore not for public awareness. But you get the picture.
In summary it was my lack of knowledge about the tool, though I had looked under the Window option first thinking along these lines, but the View menu is actually where one would go to display things about the project.
Thanks to everyone for your contributions.