Home Dashboard Directory Help
Search

CodeTypeRef in invalid state by schuchri


Status: 

Active


4
0
Sign in
to vote
Type: Bug
ID: 790287
Opened: 6/17/2013 12:29:22 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

Sometimes when looking at CodeTypeRefs the CodeModel seems to be in an invalid state.

The CodeTypeRef.AsFullName property doesn't return the fully-qualified name (ie. "Namespace.Class") but only the class name (ie. "Class").

The problem with this is that this is expected behavior for CodeTypeRefs that are generic type/method parameters (ie. "T").

The real problem lies in the fact that there is no way to distinguish between a CodeTypeRef that represents a generic parameter (=> expected behavior) or a CodeTypeRef that represents an actual type and just doesn't return the fully-qualified name (=> error).

In the debugger a property called "IsGeneric" is visible on the CodeTypeRef instance, however this property always seems to be false.
Details
Sign in to post a comment.
Posted by schuchri on 7/11/2013 at 11:10 AM
Hi!

I'm sorry it took so long (vacation...).

The attached solution is a good way to show this error. It is a VisualStudio extension that outputs something whenever it finds a CodeTypeRef with a not fully qualified type name with a length > 2 (to avoid output for every generic parameter like T).

However the real problem lies in the fact that the error seems to only occur in large solutions. Maybe the error comes from the fact that VS hasn't parsed all the necessary source files (--> the ones with types that are referenced) in all the projects yet and therefore can't provide accurate information for some types. This theory would also explain why the error hardly ever occurs on files that are re-opened automatically on solution load (the code model has more than enough time to build itself up between the opening of the file while all the other projects are loaded).

So I sadly can't supply you with a solution that reliably reproduces the error when it is opened with the supplied VSExtension. Maybe you can use a big Microsoft internal solution for that purpose.

Another important point is: Even with big projects the error does not occur always, so several tests should be made.
Posted by Microsoft on 7/11/2013 at 9:42 AM
Hi,

I'm closing this issue as a few weeks have passed with no additional information.

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by Microsoft on 6/21/2013 at 9:38 AM
Hi,

Thanks for contacting us about this issue. Unfortunately, we have been unable to reproduce the problem. Would you be able to provide a sample extension project that reproduces the problem? That would help greatly in our investigation.

Kind Regards,
Dustin Campbell
Visual Studio Managed Languages
Posted by Microsoft on 6/17/2013 at 2:05 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 6/17/2013 at 12:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
CodeTypeRef.zip 7/11/2013 19 KB