I typically code in VB.NET, but I'm going through a tutorial in C# .NET right now. I'm expecting to see a drop down list for selecting methods and properties at the top of the code file, right underneath the tabs for the code files I have open. However, I do not see these. If I open VB code, it works just fine. I've tried to look for an option in Visual Studio that I don't have turned on, but I can't find what I'm missing. Anybody have any ideas?
Go to Tools->Options->Text Editor->C#->General and check "Navigation Bar"
If you want to access the events, you can do it on design mode on upper border of the properties box, there is a "thunder" where you can access them, this part is different from that of VBasic
Tools Menu --> Options
Text Editor ---> C# ----> General ----> Navigation Bar (check this box)
Reset your entire environment. Tools--> Import and Export Settings... from this dialog you can reset your IDE settings, choosing to Reset all environment settings to one of the default collections of settings. (VB Developer, C# Developer, Web Developer, Project Manager...)
Related
I know that I can set up Visual Studio to debug through the .NET framework source code.
But is there a way that I can browse the code while NOT debugging - i.e., being able to press F12 or "Go to definition"?
I thought that if that feature isn't built into Visual Studio then there may be a plug-in that might add it?
There is a very new feature in Visual Studio 2017 version 15.6
You can see decompiled source code without any plugin! Btw, Ref12 doesn't work for VS2017.
Tools > Options , expand Text Editor > C# > Advanced, and enable "Enable navigation to decompiled sources (experimental)".
Ref: https://learn.microsoft.com/en-us/visualstudio/ide/go-to-and-peek-definition?view=vs-2017#view-decompiled-source-definitions-instead-of-metadata-c
With ReSharper it's possible to browse .NET sources by enabling ReSharper -> Options -> Tools -> External Sources -> Navigation to Sources.
After enabling this option new menu item "Navigate To -> Decompiled Sources" appears by right click on type/method/whatever.
Navigation also works with F12 for me.
I just discovered this extension that pretty much addresses my problem. The only thing is that it opens the source in the browser rather than in Visual Studio, but it's no big deal because even in the browser you can click the source code to navigate to types etc.
It was presented on Scott Hanselman's blog a couple of days ago:
Community member and fabulous coder Schabse Laks has created a Visual Studio extension for VS2010, 2012, and 2013! This extension sends calls to Go To Definition (or pressing F12 on a symbol) directly to the code online (when it's .NET Framework code, not yours).
You can download this companion "Ref12" Visual Studio Extension now! Just Goto Definition on any .NET type we have source for and it'll launch your default browser so you can explore the .NET Framework source yourself! Thanks Schabse!
Update:
As per the comments, for VS 2022 and .NET Core, use this fork of the extension: https://marketplace.visualstudio.com/items?itemName=EfreyKong.Ref12-VS2022
I downloaded the .NET Framework source code from here http://referencesource.microsoft.com/netframework.aspx.
Since I am working with .NET 4.0, I chose ".Net/4" from the list. (What is ".NET/8.0" in that list? No idea.)
I wrote some scripts to rearrange the bloody mess they give us:
Into a reasonable hierarchy of directories;
To remove duplicated code (why is every file doubled, or was my install bad?);
Rename all top-level namespaces to not conflict with native ones baked into Intellisense.
Example: System.Windows.Controls -> xSystem.Windows.Controls
Then follow these steps:
Create a new Visual Studio project of type "Class Library"
Remove all references -- yes, even the system ones.
Drag/drop all of your massaged .NET code into the root of your project.
Wait about 30 minutes for VS processing. VS will appear to freeze; be patient.
Intellisense/ReSharper still complains about heaps of problems, but now I can right click and select "Go to Declaration/Implementation".
Visual Studio is about 600MB with this project loaded.
I am using Visual Studio 2013 Ultimate.
1. Choose menu: TOOLS \ Extensions and Updates...
2. Choose Visual Studio Gallery \ Search Results. Search term: Ref12.
3. Download then install.
4. Restart Visual Studio.
5. Try: Click mouse on Class or method, press F12 and see result at http://referencesource.microsoft.com/
I've never tried this but supposedly the code is publicly available:
[Edit]
http://referencesource.microsoft.com/
There is the .NET Mass Downloader, but I think the straightforward answer to your question is, no.
However I now see Microsoft has made the code more easily downloadable.
Nevertheless note that even for your own code, when not debugging, unless you have the project open, VS does not help you locate source code (even though when you find it yourself break points will work when you start debugging again, if the .pdb files correspond).
When debugging, I would like to see objects value shown inline as you stepping through each line of code. I've seen this feature in some of my colleagues VS but I could not find any option to turn it on.
Visual Studio cannot do that by itself.
What you have most likely witnessed is the new Resharper feature. If your colleagues have this, there is a good chance your company will provide it for you, too. Don't hesitate to ask your manager for a licence, it's a great tool and will make you more productive.
(Disclaimer: I'm in no way affiliated with the company. I just think they have a great product.)
The inline hint is a new feature in Visual Studio 16.8. But we have to enable it manually.
Go to Tools in the top bar, then click on options.
Go to Text Editor in the left menu, and expand it.
Then go to C# Expand it, and go to advanced.
Now in the right-side options go to section Editor help.
Enable "Display Inline Parameter name hints (experimental)".
In the menu, go to:
Debug -> Windows -> Output
My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
Does anyone know the problem and how to restore this functionality again?
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
About possible causes.
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
Found it in Visual Studio 2019 as: Tools > Options > Text Editor > General > Show error squiggles
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
How you will do in Visual studio 2013?
TOOLS -> Options... -> Text Editor -> C/C++ -> Advanced -> Disable Squiggles: True/False (Under IntelliSense) -> Press OK
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
For example:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
Solution:
Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
For visual studio 2017 act according to HeeJae's comments in:
https://developercommunity.visualstudio.com/content/problem/113112/design-time-error-checking-isnt-working.html
i.e:
Hi. you are probably hitting a known issue. can you try this?
1.Update to latest release If that doesn’t solve it
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
3.Close VS.
4.Delete the “.vs” directory beside their solution file.
5.Reopen VS.
..
thank you
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
Good luck
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
For everyone wondering in 2021..
search for "C_Cpp.errorSquiggles" in the settings.
Make sure to have it active for the user, as well as the workspace.
No need to restart Visual Studio.
For me (VS 2019) , after trying the other answers also, setting the scope of analysis from "Current document" to Open document" brought back the missing error markers
Just go to settings and search for errors and Image in Error Squiggles. You can see the Error squiggles (Modified: Workspace - Right now you can't see it because I modified it). Just click on modified and you will see the disabled option. If by mistake you disabled it, just enable it and you can see the red line errors again in your code.
In latest edition, check for .vscode folder in same project folder. There will be a setting.json file in that. Delete the key value pair of "C_Cpp.errorSquiggles": "Disabled". Restart the vs code.
I've installed Visual Studio 2012 after reformatting my computer.
When I open a xaml file in a new empty wpf project, it opens it in a regular code editor and doesn't let me choose Design View (the option is just not there).
Right-clicking the xaml file and choosing "View Designer" opens a new code window instead of a new designer window. (yes, the same code window is actually opened twice)
Right-clicking the xaml file and choosing "Open With" shows that I'm missing the Xaml UI designer editor. (it doesn't show anywhere on the list)
I've tried running "devenv.exe /ResetSkipPkgs" and "devenv.exe /resetuserdata" and Repairing visual studio's installation all together (both by re-installing and the Repair button in the installation wizard).
Nothing seems to help.
Anyone familiar with the problem and knows how to fix?
Something else to try, I know a lot of folks disable the designer for performance reasons. This is done with a file extension association in visual studio. I'm wondering if the reverse may help you?
If you right click a XAML file in your solution and select Open with...
... You should see XAML UI designer as an option! select it and click 'Set as default'.
Hopefully that works for you.
I am just guessing, but my experience with VS2012 is, that sometimes it cannot access the registry, because it fails to set an owner for the newly created registry keys.
Without owner noone but the System can access those Keys.
I used resplendence Registrar Registry Editor Trial Version to Fix the broken Keys.
I would especially check
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0
and
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\XamlEditor
because you can find all the settings there.
In addition i experienced this error only on recently reformatted win 7 systems.
And all of them have ssd's, but i am not sure if it only occurs on systems where no "old" harddrive is. But i found some people on msdn who also experienced issues whith VS2012 and having only a ssd in the system.
I am in the process of creating a Wizard to help my organization auto create a base project for all applications. The idea is that a programmer can enter a project name, a few other basics and the process will create some projects, add other project from source control, configure IIS, etc...
A lot of the work is done by simply using project templates and the IWizard interface for some of the more complicated operations. What I am trying to do is this, once all of the projects are auto created, I am creating a workspace and automatically moving all of the files under source control. I am also doing things like adding common projects, setting up some special settings in IIS, etc... The problem is that the solution file, although it is under source control, is not actually configured to use source control.
Anyone have an idea on how to programmatically configure a solution so that it is part of source control and ready to use? I've run into a brick wall and can't seem to get any further. BTW: In case a didn't make it clear, I'm essentially trying to do the same in code as right clicking on a project and selecting "Add Solution to Source Control."
Like I've said, I've got most of the issues solved. Just this last one is giving me fits...
The important facts:
Windows XP
VS 2008
TFS
Using Microsoft.TeamFoundation objects....
Can you handle this through the Visual Studio extensibility framework? EnvDTE basically provides access to anything you can do interactively...
I just did what you said while recording a Macro; Looks like:
DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate()
DTE.ActiveWindow.Object.GetItem("CLSTestSolution").Select(vsUISelectionType.vsUISelectionTypeSelect)
DTE.ExecuteCommand("File.TfsAddSolutionToSourceControl")
Perhaps you can start there?