Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Reference.Services (C#)
Collapse the table of content
Expand the table of content

Reference.Services Sample (C#)

Visual Studio 2005
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

The Reference.Services C# sample demonstrates:

  • Providing a global service available to another VSPackage.

  • Providing a local service available only to the VSPackage implementing it.

  • Handling service requests.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

To build and run the sample

  1. Open the Reference.Services.sln solution.

    The default location is <drive>:\Program Files\Visual Studio 2005 SDK\<build number>\VisualStudioIntegration\Samples\IDE\CSharp\Reference.Services.

    NoteNote

    This sample includes an overview document with detailed implementation notes. To open it, right-click Overview.xml and click View in Browser.

  2. Press F5 to build the sample, register it in the experimental hive, and start Visual Studio from the experimental hive.

To see the sample's functionality

  1. On the Tools menu, click Get C# Global Service.

    A message is displayed in the Output window indicating that the global service was consumed.

  2. On the Tools menu, click Get C# Local Service.

    A message is displayed in the Output window indicating that a test succeeded. The test guarantees that the client VSPackage failed to consume a local service on another VSPackage. This illustrates that the service provider passed to a VSPackage by Visual Studio cannot be used to consume local services.

  3. On the Tools menu, click Get C# Local using Global Service.

    A message is displayed in the Output window indicating that the local service was consumed by a method on the global service.

Demonstrates

See Also

Community Additions

ADD
Show:
© 2015 Microsoft