Partager via


ProjectTypeResolutionService Class

An abstract class that provides the Visual Studio implementation of the ITypeResolutionService interface.

Namespace:  Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

Public MustInherit Class ProjectTypeResolutionService

Dim instance As ProjectTypeResolutionService
public abstract class ProjectTypeResolutionService
public ref class ProjectTypeResolutionService abstract
public abstract class ProjectTypeResolutionService

Remarks

Visual Studio type resolution is based on resolving a project type name to its corresponding Visual Studio references. These references can take on several forms:

Kind of Reference

Description

Files On Disk

These are simple disk-based references that may not break the way that GAC-based references work. This means that a reference to something in the GAC must be loaded from the GAC, not from the SDK directory.

References to a Project

Requires the location of the project output file. Type resolution must also monitor Visual Studio events like renaming a project output file and switching configurations. In the event of a configuration switch the built project will output to a different directory.

Generated Outputs

Tools can generate code directly into the project. This code becomes part of the project, but it can be demand compiled by the project so its binary is accessible without building the entire project. These generated outputs must be searched first, because the types within them always conflict with the current project. Type resolution must also be aware of Visual Studio events like 'rebuild generated outputs' because these are not built automatically.

Each loaded assembly is backed by an AssemblyEntry object, and these objects are factored into groups as described above. Both Files On Disk and References to a Project are pointers to the same objects. Two parallel lists are implemented because References to a Project are always loaded in-memory and this process degrades performance. The retrieval scheme first traverses the Files On Disk list because many of the dlls it references can be loaded via the GAC, which is more efficient from a performance standpoint. If retrieval fails for the Files On Disk list the lookup next transverses the more expensive References to a Project list.

Loading Generated Outputs requires compilation from Visual Studio which makes them the most expensive type to retrieve. Though the performance cost of evaluating these items for a match represents a big performance hit, Generated Outputs still must be checked before References to a Project because Generated Outputs, a special subset of References to a Project, allow duplicate types.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Shell.Design.ProjectTypeResolutionService

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ProjectTypeResolutionService Members

Microsoft.VisualStudio.Shell.Design Namespace