Visual Studio 2010 Beta 2 Known Issues – Part 2

This post continues my unofficial list of known issues in VS 2010 Beta 2 (see Part 1). As we continue getting Beta 2 feedback and investigating issues, it's time for another update on the issues we've been seeing. Please keep in mind that due to the volume of the issues, I'm only mentioning the ones I was involved with or consider important.

Crash during normal editor operation

There is a rare situation where Beta 2 can crash during normal editing or viewing C# source code. Nevertheless, it happens often enough to become top 1 reported crash for C#.

I'm very happy to say that we have identified the root cause and are working on a fix.

Details: This is an extremely complex and hard to reproduce bug involving native code, threading, and working with Task Parallel Library from native code. The new C# IDE feature, Highlight References, is written in managed code and uses TPL (Task Parallel Library) to calculate references on a threadpool thread. However a certain portion of the language service (called the Language Analysis engine) is written in native code, so we had to do some cross-boundary and cross-thread manupulation. Our developers Ian (from C# compiler) and HeeJae (from C# IDE) worked very very hard to investigate the dumps that you folks were sending in and finally they've found the bug. The good news is that as more and more of Visual Studio gets rewritten in managed code, we hope to see less of such bad bugs in the future.

So thanks to you for clicking that "Send Error Report" button – it really helped us to fix the top 1 reported C# crash!

Cannot open C# source file: Error message "The operation could not be completed. Invalid pointer." or "Object reference not set to an instance of an object"

This one is due to the Tools Options Fonts and Colors using a raster font instead of a TrueType font:

https://blogs.msdn.com/visualstudio/archive/2009/10/27/VS-2010-Beta2_3A00_--Workaround-for-Raster-Font-Settings-Issue.aspx

The fix is easy: switch to a TrueType font such as Consolas or Courier New.

The editor team has fixed this one already.

The application cannot start (VS black screen)

Weston writes about this one in detail: https://blogs.msdn.com/visualstudio/archive/2009/10/29/how-to-fix-the-application-cannot-start-error.aspx 

This is due to us being unable to read certain profile settings.

The workaround is basically to run devenv /resetuserdata from the Visual Studio command prompt, but I encourage you to follow the link above for more information (e.g. how to save your settings beforehand).

This is already fixed as well (now even if the profile contains the errors we will start successfully and deal with the errors).

TextOptions does not appear in the IntelliSense in XAML designer

The WPF team has completely rewritten the WPF text rendering to get rid of the font blurryness issue. The old style is still the default, to enable the new mode you need this simple attribute in your XAML: TextOptions.TextFormattingMode="Display". The problem is – TextOptions won't show up in IntelliSense!

The workaround is to ignore IntelliSense and just build your project – things should just work.

This has been fixed as well.

All menus except the File menu disappear

It happens extremely rarely, but we saw it three times already – the menus are just gone!

image

This one is very very hard to reproduce and we're still investigating this right now – for some unknown reason something is messing up the Style or the ControlTemplate for the menus. If you happen to run into this inside a virtual machine, you can really help us investigate the issue by pausing the machine in the state where VS is running and menus are gone.

Feel free to open a bug on https://connect.microsoft.com/visualstudio/feedback or let me know and we'll send you instructions on how to upload the VM image.

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Editor.Implementation.IVsGlobalUndoCapableUndoManager'.

---------------------------

Microsoft Visual Studio

---------------------------

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Editor.Implementation.IVsGlobalUndoCapableUndoManager'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{305E8709-55B7-4732-B872-1C073AB58047}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

---------------------------

OK

---------------------------

 

Right now we can't reproduce it so we're looking for any help – call stack, minidump with heap, ActivityLog.xml etc. You can read more about the ActivityLog here:

https://msdn.microsoft.com/en-us/library/ms241272.aspx

We'd appreciate any help!

Expression.Compile generates incorrect code for (int?) conversion

 using System;
using System.Linq.Expressions;

class Program
{
    static void Main()
    {
        Expression<Func<ValueType, int?>> expr = x => (int?)x;
        Func<ValueType, int?> converter1 = x => (int?)x;
        Func<ValueType, int?> converter2 = expr.Compile();

        int? a1 = converter1(null); // (int?) null
        int? a2 = converter2(null); // NRE
    }
}

Expected: both the direct delegate and the one generated with Expression Trees should work identically. Actual: the expression tree one throws a NullReferenceException.

Thanks to controlflow for reporting this! It's a good bug, but unfortunately it will require a risky compiler change that we don't want to take so late in the product cycle. We've postponed the bug for a later release.

Delegate.Combine doesn't support variance

 using System;

class A { }
class B : A { }

class Program
{
    static void Main()
    {
        Action<B> b = _ => { };
        Action<A> a = _ => { };
        b += a;
    }
}

 

This program compiles fine but causes an exception at runtime. The CLR team decided to postpone this to a future version.

Completion List doesn't show up for certain lambda parameters in multiple overload scenarios

 using System;

using System.Linq;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        var query = Enumerable.Range(0, 100);
        Parallel.ForEach(query, (i, p) =>
        {
            Console.WriteLine(i);
            p.
        });
    }
}

 

In this code, IntelliSense doesn't show after p. Another great bug from controlflow. We've fixed this one (it had to deal with picking the right overload of ForEach given an incomplete lambda statement).

Debugger data tips are leaking GDI handles

Hovering the mouse cursor over variables during debugging and expanding the nodes in the tips will leak GDI handles. After the Visual Studio process will run out of GDI handles (and each process can only allocate 10,000 handles), it will crash. Usually this happens after 10-15 minutes of intensive debugging with datatips, depending on circumstances. You can watch the GDI handles of the devenv.exe process in the Task Manager (if you select GDI in View –> Select Columns).

This is a stress bug that has been fixed by the debugger team recently.

Tooltips on toolbar buttons are not displaying keyboard shortcuts

As part of the WPF rewrite, we had postponed this work until very late, and only recently have fixed it (post Beta 2). Now all the keyboard shortcuts show up when you hover your mouse over a toolbar button. You will not be able to turn them off though :)

Printing formatted source code with color is not supported

This is actually not a bug, it's by design. We had to cut this low-impact feature from 2010 because of tight resources constraints as we've reimplemented the editor from scratch. This feature will hopefully come back in a later release of Visual Studio, maybe as an add-in.

More High DPI and other accessibility issues

I just keep finding more and more High DPI issues, hoping that if I find and report them now, you guys won't have to.

Combobox missing right edge:

image

The shell team decided not to fix this because of tight schedule and resources.

Snippets background poorly visible on High Contrast Black

image

The editor team has decided not to fix this because the colors are configurable.

Silverlight Out-of-Browser settings dialog clips some controls under 120 DPI

We're looking into fixing this right now.