Visual Studio: "Go To Definition", inconsistent behavior
2014-07
In Visual Studio, to view a class' code, you can:
- right click the class > Go to Definition.
- Ctrl + Click the class name in code file.
- F12
Each of which are used to navigate the definition.
However, the result differs and I cannot figure out why. Sometimes, it does as expected and brings me to the class code; but, other times it opens up the Object Browser, which doesn't really help me too much.
Does anyone experience this also? Why am I brought to the Object Browser instead of the class directly?
Note: I'm sure this behavior -- while slightly annoying -- is completely logical once I understand the underlying reason this happens.
I am trying to install Visual Studio 2012 on Windows 7 Home Premium 64-bit machine, but installation fails. I tried to install all versions (Premium, Ultimate etc..) but I'm getting the error below.
The machine is not domain joined and I'm logged in as administrative user. I was using Security Essentials but turned it off before the installation. Installation source is from MSDN.
The error log is too big to upload, but here is the important portion from the log:
[1350:2188][2012-10-07T18:24:13]: MUX: ERROR: The type initializer for 'System.Windows.Media.FontFamily' threw an exception. [1350:2188][2012-10-07T18:24:13]: MUX: Stack: at System.Windows.Media.Typeface..ctor(FontFamily fontFamily, FontStyle style, FontWeight weight, FontStretch stretch) at MS.Internal.Text.DynamicPropertyReader.GetTypeface(DependencyObject element) at MS.Internal.Text.TextProperties.InitCommon(DependencyObject target)
at MS.Internal.Text.TextProperties..ctor(FrameworkElement target, Boolean isTypographyDefaultValue) at System.Windows.Controls.TextBlock.GetLineProperties() at System.Windows.Controls.TextBlock.EnsureTextBlockCache() at System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Window.MeasureOverrideHelper(Size constraint) at System.Windows.Window.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Interop.HwndSource.SetLayoutSize() at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual() at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight) at System.Windows.Window.CreateSourceWindowImpl() at System.Windows.Window.SafeCreateWindow() at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at Microsoft.Devdiv.Bootstrapper.ManagedUx.RunUI(ViewModelCommonUi viewModel) at Microsoft.Devdiv.Bootstrapper.ManagedUx.InternalRun() at Microsoft.Devdiv.Bootstrapper.ManagedUx.Run() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
Possibly corrupted fonts. Try these 3 methods to fix the problem
It seems like it needed some components from VS 2010, so I installed VS 2010 first then install VS 2012 and it was successful.
After this I un-installed VS 2010.
It seems very weird, but this only worked for me.