Visual Studio 2019 hangs on "Execute Suggested Action" when adding a reference - visual-studio

I've got a problem with Visual Studio Enterprise 2019, it hangs on "Execute Suggested Action" when I use it to add a reference to another project or library.

It's a Visual Studio bug. They are working on it.
Take a look here: https://developercommunity2.visualstudio.com/t/Infinite-suggested-action-never-ends/1223055
The fix will be probably released on the next release (16.9).
UPDATE:
Still in vs 16.8.4 but should be solved in 16.9.
UPDATE 2:
In 16.9 PREVIEW 3, this issue seems to be resolved.
UPDATE 3:
Fix has been released! You can download the new version of VS now.

if anyone struggle with adding references: go to your project -> right click on Dependencies -> select eg Add Project Reference -> look for proper reference

I was having the same issue when adding on the suggestion of Intellisense. For me, it turned out to be an issue of cyclic reference. My bad. I corrected it and now it doesn't hang.
It was VS 2019 community, Windows Forms (C#)

Related

Visual Studio 2015 Enterprise with ReSharper 10 Ultimate -- Cannot be properly resolved

I have Visual Studio 2015 Enterprise, version 14.0.24720.00 Update 1 as well as ReSharper 10 Ultimate, version 10.0.2 installed. I have a typescript file that is using AtScript syntax to refer to the Angular2 directive module, as its annotation. However, ReSharper is stating the following error:
Symbol 'Directive' cannot be properly resolved, probably it is located in inaccessible module.
Below is the full error tooltip.
The application compiles and runs as expected, and the angular portions of the application also function as desired. It appears as though this is a ReSharper false negative. Is anyone familiar with a workaround other that simply disabling ReSharper or ignoring the warning?
The issue is simply a bug with the latest version of ReSharper, if you Suspend ReSharper the issue simply goes away and all the source code works as expected.
Update
This has since been addressed in the ReSharper 2016.1 version.
As a workaround, if you are using angular2 from your node_modules folder, then you can reference it directly instead of relying on the new node module resolution. For example you can do:
import {Directive} from '../../node_modules/angular2/core';
As of 02/2016, the issue is fixed in the ReSharper Ultimate 10.1 EAP 3
this version still has some other typescript issues though
Original answer, explaining why it couldn't work in previous versions:
Had the same setup and same issue. I strongly believe this is related to: "moduleResolution": "node"
https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FRSRP-273158
Unfortunately, no way now. We're working on node.js support for the next ReSharper version.
If updating to latest ReSharper version does not work and this only affects .js(x) and .ts(x) files you only need to suspend those. You can do that by going to ReSharper -> Options -> Unclick JavaScript and TypeScript.
It could be Resharper problem. disable it from tools->option->Resharper Ultimate->General->Suspend Now and the errors will be hide.
I was getting the same problem on one of my modules on Resharper 2017.1 in Visual Studio 2017.
But after updating my Resharper to 2017.2.2, that solved the problem.

VS 2015 & vNext/MVC 6 IntelliSense issues - Resharper

I am having an issue with Visual Studio 2015 RC and IntelliSense when running the MVC6 vNext project template. The project builds and runs just fine and nuget restores packages if I manually remove them. The issue is that VS 'shows' that it cannot resolve my using statements throughout the project, thus breaking intellisense. Has anyone had this issue where it builds and runs fine but does not show the using statements as resolved?
OK, figured it out. Suspending resharper removed the red text, but still no intellisense. Tried to update resharper via the resharper menu in VS, this failed. Manually installed version 9.1.1 of resharper over version 9.0.0, this made everything happy again (full install removed previous version of resharper).
You need to use ReSharper 2016.2 or above to support .net core.
You can use the early access version available from https://confluence.jetbrains.com/display/ReSharper/ReSharper+2016.2+EAP
This is an issue of Resharper 9. Don't use Resharper 9 with MVC 6. It will suggest you the wrong path when you import CSS or JavaScript file to your page, as I said in this question.
So, the solution is: update to Resharper 10. However, there are many problem remains when using Resharper with MVC 6.

'Go To Definition' greyed out in VS2013

I just installed Visual Studio 2013 on 2 machines. When I open the same project on both machines and open the same codebehind, if I right click a method call, 'Go To Definition' is greyed out on one machine but not the other. This is for any method call in a referenced assembly. Methods in the current code behind work fine. The machine it doesn't work on is a clean build.
Did I miss installing something?
Same issue. I simply right-clicked the project and performed an Unload Project. Reloaded it, and Go To Definition is working again.
I did face it once before. Steps I followed after which it started to work for me:
Right Click on solution and run "Clean Solution".
Right Click on Solution and run "Rebuild Solution".
Keep in mind you also need the microsoft sql server compact 4.0 for intellisense to work.
Closing all of the open files in Visual Studio and opening them again from the Solution Explorer fixed it for me.
I have face this issue while upgrading from vs 2012 to vs 2013. when you open the vs.2012 to solution into the 2013 then go to definition was not working.
I have solved it by creating new project in the vs.net 2013 and added all the objects back to the solutions. it is working without any issues now.

VS2013 Build "Does not support previewing"

Every time I try to build my solution in VS2013, nothing builds, no errors - But in the status bar it says: "This item does not support previewing"
I googled around a bit but have come up empty.
But if I right click on each project and select build it works fine.
Any ideas?
Perhaps this message is totally unrelated... Post hoc ergo propter hoc
Steps to reproduce on my machine:
Right Click any project in solution: select build
Status bar displays Build successful
Right click solution select build
Status bar displays : "This item does not support previewing"
Perhaps it isnt related, but it sure does appear to be.
I was able to fix this... Somehow nothing was selected to build in the solution configuration. I right clicked on the solution, went to properties and then selected COnfiguration Properties and clicked the Build box for all the projects...
I have no idea how they became unchecked, only thing I can think of is a co-worker was trolling me.....
I've had this problem (i.e. debug not starting, and no error message) with Visual Studio 2015 in the following two cases:
after loading a solution that had previously been built with Visual Studio 2010
and also after using the "save as" function in Visual Studio 2015 to update a solution that had been started with Visual Studio 2010 (using Save as updates the solution file and sets the active Visual Studio version to 14 - i.e. VS 2015).
In both cases, deleting the bin and obj directories under the startup project fixed the problem. It's also worth closing visual studio and making sure that there are no {yourprojectname}.vshost.exe processes still running - if there are then kill them before running visual studio again. On that note, if you have multiple versions of visual studio on your machine, you should also check that you don't have the same solution open in the other version of visual studio at the same time (I've done that one myself).
One of the comments here suggests disabling the "enable visual studio hosted process" option. Don't do that if you can at all avoid it: you'll lose lots of debugging functionality (particularly in the area of being able to edit code while your solution is running).
Hope that helps someone out there.
Solution for VS2015
"this item does not support previewing" vs2015 (Visual Studio 2015/2016)
Step 1. Go to Control Panel -> Programs and Features
Step 2. Uninstall all: Windows Software Development Kit - Windows 10.0.10586.15 (maybe you have diff ver)
Step 3. Download new latest Windows Software Development Kit
https://go.microsoft.com/fwlink/p/?LinkId=619296
Install & Create new project, Done!
Dclick on MainPage.xaml and you will see Loading designer...
1: Add below lines in App.conf
<specFlow>
<unitTestProvider name="MSTest"></unitTestProvider>
</specFlow>
2: add a reference to Microsoft.VisualStudio.QualityTestTools.UnitTestFramework.dll
right click on your project and select: Add Reference
3: add using Microsoft.VisualStudio.TestTools.UnitTesting; in Step Defination
4: goto feature file and run it. This is what solve my problem on vs2013
I faced same issue with .aspx file. I just right click on the .aspx file and select open with (HTML Editor). You can choose any form the list.
I have come across the same issue for me, I have opened a project in VS 2010 and then when I open the same in VS 2015 then his error has occurred.
Solution:
By Closing the VS2010 project solution fixed the issue.

CodeLens not showing references

CodeLens stopped working for some reason in project solution that I'm dealing nowadays. It is not showing references instead "- references". However, when I open up Visual Studio with another project It works like charm.I can confirm that CodeLens is enabled. Do you have any idea to make it work?
My Solution:
Toggle the CodeLens feature off and then on again.
Note: Many have found the feature to be turned off after an update so you just need to turn it back on. Thanks to #razblack for calling this out. Don't forget to give his comment an upvote if this was your issue!
Go into Tools -> Options... -> Text Editor -> All Languages -> CodeLens.
Uncheck "Enable CodeLens" option and click OK.
Go back into Tools -> Options... -> Text Editor -> All Languages -> CodeLens.
Check the "Enable CodeLens" option and click OK.
Note: I've fixed the issue once before by closing the problem .cs file and then reopening it. Closing any referenced files may also be required.
My Problem(s):
Similar to the original poster, CodeLens stopped refreshing references after I made a bunch of refactors. I was seeing stale references to code that didn't exist and I was also seeing the "- references" issue as described in the original post.
My Environment & Specific Scenario:
Visual Studio 2015 with Service Pack 2 and Resharper Ultimate 10.0.1
I was doing a major overhaul with a ton of refactoring and my project wasn't compilable for an hour or so. Once I could compile the project again, the references weren't working.
Same problem here.
CodeLens works normally with small solutions, but not working with large ones.
And this behavior is accompanied with crash of Alm.Shared.Remoting.RemoteContainer.dll process.
Tried in VS 2013 Update 4 and VS 2013 Update 5 RC.
Solution:
Close all programs and clean %LocalAppData%\Temp folder (or maybe just ALM folder inside it).
A simple solution, which works!
I did try enabling CodeLens in Visual Studio (2015) -->
Quick Launch (Ctrl+Q)
Options (CodeLens)
But, it was enabled :( Then, it did work with: (Closing the programs),
Win+R --> %temp% EnterDelete all
For me, CodeLens was disabled, so make sure it is still enabled.
I know it is an easy answer, but it might help some developers.
Go to Tools -> Options -> Text Editor -> All Languages -> CodeLens then click the "Enable CodeLens" option if it is not checked and then save it.
It looks like VS disabled it for some reason, maybe after an update or slow startup.
Try to remove .suo file which is storing some enviroment/solution settings. This helped me.
Just had this problem with VS 2019.
I tried disabling / enabling codelens and it didn't work.
I deleted the .suo after that and it didn't work.
I tried disabling / enabling codelens again (after deleting the .suo) and now it works again.
UPDATE (about 2 weeks later):
It started happening again and this time I disabled IntelliCode in Extensions and all of a sudden Codelens started working again.
UPDATE AGAIN (25 Nov 2019):
I reported this to Microsoft and had a dialog with them. You do not have to turn off all of Intellicode at this time, only disable Intellicode Refactorings in Tools -> Options -> Intellicode. The actual fix is slated for VS 2019 16.4 I believe.
You may have circular references in your solution that prevents CodeLens from working. Some details were provided in the comments for this issue on the Visual Studio Connect site:
Somehow, two of my projects in my solution ended up referencing each
other causing a circular reference. I think it was a by-product of
Resharper's shortcut to reference an undefined class. Once I was
cleaned up all of the references, I'm now getting valid values in my
reference counts.
How did you go about "cleaning" up references?
In my case, my solution has multiple project files. In the references
folder of Project A, there was a reference to Project B. In the
references folder of Project B, there was a reference to Project A.
This was causing the circular reference. If you try to do this
"manually", VS will prompt you with a warning regarding the circular
reference.
To clean this up, I removed the reference to Project B from my Project
A. I had do some minor class definitions in my Project B so everything
would still compile in the end.
I found out that if you block the Visual Studio with the Firewall, the Code Lens did not work.
So unblock it from the firewall to make it work.
Or edit Firewall settings for file:
C:\Windows\Microsoft.NET\assembly\GAC_32\
Microsoft.Alm.Shared.Remoting.RemoteContainer\
v4.0_12.0.0.0__b03f5f7f11d50a3a\
Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
I had this problem with VS2015 that already had "update 1" installed.
The thing was that I originally installed VS2015 with the "custom" setup, not the "default" option, and I accidentally left out the "Git for Windows (3rd party)" option under "Common Tools".
This can be fixed by these steps:
Run the VS2015 setup again (from control panel - uninstall program)
Right click VS2015, select "Change"
On popup screen, select "Modify"
On setup screen, select "Git for Windows (3rd party)"
Move on with the setup, install selected features
In Visual Studio Professional or Enterprise you can enable CodeLens by doing this:
Tools → Options → Text Editor → All Languages → CodeLens->Enable
This is not available in some Community Edition versions
Try deleting .suo file inside of the hidden .vs folder in your project. This worked for me in VS 2017.
My Problem
Always directly after enabling CodeLens, press OK, i see the extra space required for the CodeLens information and than it disappears and when i look at the options again it is diabled. Driving me nuts.
Approaches
Deleting caches/configurations. Clean start without Extensions work. Normal start without ReSharper works. Reinstall ReSharper + deleting cahces -> False behavior
Solution
Unter Extensions - ReSharper - Options - Environment - Performance Guide was "Disable CodeLens for all languages" set to "Fix Silently". Set to Ignore -> WORKS!
hope this helps someone
I had the same problem, but one's of my colleagues who has the same development environment than me, doesn't have it...
The only one difference between our both environment was the quantity of RAM. There is 10GB allocated to his VM, and on mine, there is 6GB allocated. Since I upgraded the quantity of RAM allocated to my VM to 8GB, all my references are shown !
Installing Update 1 for Visual Studio 2015 fixed the problem for me.
Download Update 1
After reading the answer to this Stack Overflow question CodeLens only showing references? I decided my problem with Codelens was I was running Visual Studio 2015 Update 1 but was using Team Foundation Server 2012. I upgraded to TFS 2015, which upgraded in place and didn't require any new settings or URIs to be connected to Visual Studio as before. Then I reloaded my solution - but I still had the issue where it just said "– references" everywhere. I closed Visual Studio, started it again and reloaded my solution and finally I saw the correct reference counts as they used to show.
I found on the new VS 2015 update 3 it happens on a large class in a medium level solution 10+ projects and has nothing to do with circular references, a bad SUO file, or other things. It appears just deleting the temp file location(as mentioned already), closing VS and then reopening and hitting 'ALT+2'(forcing a reference find for Code Lens) made it magically work for me.
It also appears in some solutions and projects Visual Studio will create an old referenced suo file in .vs folder. I don't know the exact rhyme or reason, but it could be created in my case and the CodeLens worked again. It could potentially be a Visual Studio options is somehow referenced in projects under source control. As I know this happened with an older solution I have upgraded many times that was under GitHub control and it does have an .gitignore file(ignore files could change depending on source control). Suffice to say I have had similar things happen with other techs in the past when there is a lock on a source control file that should be updated and won't update. Simple answer is to add to an ignore and delete the settings file.
I have Visual Studio 2017 Professional on Windows 10.
I have observed this under several circumstances:
MicroSoft decided I needed some critical update for Windows and it installed while I was working - causing some of the VS components to crash.
Visual Studio update was received in background.
Some component of Visual Studio crashed - not the VS just some attached feature (did not note exactly which one)
No known cause.
In each of these cases I did in order (sometimes it worked after each of these)
Build / Rebuild solution
Build / Clean Solution
Close and Restart Visual Studio
Remove Symbols cache, restart VS
Close BOTH VS and SSMS and restart them
Close VS and Restart Windows
Close VS, force all pending Windows updates to load, restart Windows
In options, Uncheck Codelens/apply and re-check/apply (OK button)
I tried most of the solutions above without luck, as I also saw this problem. On top, certain newly added classes were showing up as white/black (regular text) in Visual Studio.
Changing to Release typically helped, but wasn't a long-term solution.
However, this helped on both issues - verified on another machine. Maybe some of the steps can be left out.
Close all document tabs
Clean solution
Right click on solution, click "Enable Lightweight Solution Load"
Close solution
Reopen solution
Right click on solution, click "Disable Lightweight Solution Load"
Close solution
Reopen solution
Rebuild
Explicitly enable CodeLens in the workspace settings.json:
// show code lens on editor
"editor.codeLens": true,
Verify that the following properties show on the editor:
// inline count of reference for classes, interfaces, methods, properties,
// and exported objects
"typescript.referencesCodeLens.enabled": true
I could fix my problem with C# CodeLens and Omnisharp.
My C# extension was 1.25.0.
What I did to fix my problem:
C# extension -> Unistall -> Install another version -> Version 1.24.4
After that in the settings I searched for "omnisharp: use global mono" and set it from "auto" to "alwayse".
Then restart Omnisharp and wait for it to compile and show references.
Removing data from %temp% folder resolved my issue in VS 2022.

Resources