'Go To Definition' greyed out in VS2013 - visual-studio

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.

Related

the breakpoint will not currently be hit at Vs 2015

In my WCF project at Vs 2015 when I add break point for debugging I got this message:
the breakpoint will not currently be hit no symbols have been loaded for this document.
I do googleing and none of other's answer worked for me !!!
for example: Right click the Solution in solution explorer, click "clean solution", this deletes all the compiled and temporary files associated with a solution.
and this and this
any suggestion?
thank you
If your solution is having shared projects with other solutions which is also open then close the other solution. Then clean the solution and restart Visual Studio. Then do rebuild (rather than build, though it is cleaned).
Hope this will fix the issue.
I finally got what is my problem. I have a big mistake. I decide write that , where was my problem because maybe it is helpful for other developer.
I fresh installed windows and after that I installed VS 2015. because I did not install IIS , Vs used of IIS Express. this is was my problem. for solve that, I installed IIS and then in properties of my project and Web section and server part I select Local IIS and then Create virtual directory. now my problem gone.
Right Click the Project and click properties.
Under Build the Active Configuration should be set to Debug.
While running the code with F5 or Play button.
Make sure Debug is selected instead of Release in the drop down next to Play button.
I put myself in a stupid situation.
I remember setting this, and it was a bad idea...
In the Attach to Process dialog, I had the Attach to: set to the older Managed setting 3.5, 3.0, 2.0.
when I should have been using Managed (4.6, 4.5, 4.0). I'm actually using 4.7, but this works for me.
Be sure to match your target framework!

Visual Studio Project Wizard fails

The Autodesk ObjectARX project wizards fail to create projects in visual studio professional. I only see in the status bar at the bottom that it has failed. How can I tell what's wrong?
I've checked the visual studio logs (using devenv.exe /log) with nothing reported. And I don't see any other logs. What else can I do?
I should add that there should be a ui, but nothing appears. It fails right away.
Uninstall the wizard.
Right click on wizard setup file
Troubleshoot compatibility and follow steps to install
Try, it works
You should put the ObjectARX folders (inc, lib or so) to "C:\ObjectARX".
Another place is unacceptable.
I had the same problem because on wizard 2018 installation leave field "Registered Developer Symbol" empty. Then on using wizard you can change this symbol to any other.
Other name for ObjectARX directory allow successfully install wizard 2018 but then will be problem in project settings where this path hardcoded as c:\ObjectARX. So better use c:\ObjectARX.

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.

What's the reason for error message? I am using VS 2010 professional edition

What's the reason for error message "The snapshot is out of date and cannot be used anymore because type tree has been updated, A new snapshow needs to be acquired"?
This error appeared right after I launched VS2010 and added username/pwd to connect to TFS repository.
I am using VS 2010 professional edition.
It happened to me with VS2012 as well after loading the project without source control binding, a local simple WinForms project. All I needed to do was Clean & Rebuild. After that the problem was solved.
This is a bug in Visual Studio. According to http://connect.microsoft.com/VisualStudio/feedback/details/742959/the-snapshot-is-out-of-date "We've taken a closer look at this problem and it isn't one that we'll be able to solve in the next release of Visual Studio."
They recommend waiting around until the background language parser service is done (or, in other words, don't try to be too productive there partner.) My experience is that closing all documents, cleaning the solution, rebuilding it and then closing and re-opening with a pause after does remove the error.
Until you do something silly, like edit code. Then all bets are off again as to when it reoccurs.
I had a similar issue with VS2012 and after rebuilding the solution twice, I still saw the same error message.
Following an advice from a post from this site, I closed the Designer tab, reopened it from the Solution Explorer, and the problem was resolved.
I got this error too, but after I unload project and reload project, the problem was resolved.
Simply restarting Visual Studio 2012 was a workaround for me, but it kept happening about every hour and having to restart visual studio that often was very annoying.
I also found this post which suggests that the Productivity Power Tools are the problem and to simply turn off the Automatic Brace Completion in Tools->Options->Productivity Power Tools. Since making this change I haven't seen the error message again :)
I'll note though that I am using Visual Studio 2012 and the OP is using Visual Studio 2010, but the Productivity Power Tools are available for VS 2010 too, so this may still fix the problem in VS 2010.
The same issue persists in VS2013, but no amount of Clean/Rebuild or restarting VS will help. The only way I can do a successful publish, is to disable the AutoT4MVC extension.
I got this error too. I closed Visual Studio 2012 and opened it again and the error was gone.
I got this error when I had conflicting class names / namespaces. I was referencing a UserControl from a different DLL in my XAML file which had the same name as my XAML file (class name). Maybe this helps.
I used Visual Studio 2012, and just faced this error on my Windows 8. It seems like Turning off the VM and restarting Visual Studio fixed the issue.
I just got this with VS2010.
I had a form with a user control (UCa) with a user control (UCa) from a different project on it. Made a change to the UCb then flicked to the designer for the form and boom! Snapshot error.
Resolved by a full clean and then rebuilding just the UCb project before building the rest of the project.
I'm using Visual Studio 2012, and I got this error when starting Visual Studio, letting TFS connect to the server, and THEN opening my solution. The fix was simply closing VS and launching the solution directly.
I'll throw my two cents in here as well.
I've tried every combination of Clean, Rebuild, Restart, etc. What I've found is that restarting Visual Studio usually makes the problem go away for at least one Publish. Here's the weird part, though. You can also fix the problem by doing absolutely nothing. If you just let Visual Studio sit for about a minute or two, and then publish, it will usually work just fine. There's some background voodoo going on here, and waiting for it to finish seems to do the trick.
I have a solution with two parts that need published. One is a WCF service application, and the other is the ASP.NET MVC5 website itself. Anytime I publish the services, and then try to publish the site I'll see this error. I can publish the services, restart VS, and then publish the site, OR I can publish the services, go get a drink, and then publish the site. As long as I give VS a chance to "settle" between any kind of rebuild and the publishing of the site, everything seems to work as expected.
Take a walk, come back, problem solved. OR if you don't have the time. Clean, Rebuild, Restart, Publish (lather, rinse, repeat).

Resources