Skip to content
| Marketplace
Sign in
Visual Studio>Templates>Brokered WinRT Component Project Templates
Brokered WinRT Component Project Templates

Brokered WinRT Component Project Templates

vs-publisher-713547

|
6,735 installs
| (1) | Free
This package contains project templates used to create Brokered Windows Runtime Components and their Proxy Stubs, which enables side-loaded modern applications to communicate with pre-existing desktop components.
Download

This package contains project templates used to created Brokered Windows Runtime Components and their Proxy Stubds, which enables side-loaded modern applications to communicate with pre-existing desktop components.

This solution works on Windows 8.1 update or later version.

It contains two project templates:

1. A C# project template for you to create the Desktop Windows Runtime components that are used to bridge modern application and pre-existing desktop code.

2. A C++ project template to generate the IPC proxy stub that will be used in your modern application.

For more details about the Brokered Windows Runtime Component, please review whitepaper on MSDN:

http://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx

 

Here is a brief guidance on how to use the template to create a brokered WinRT component:

  1. Create a new Brokered WinRT Component using the Templates -> Visual C# -> Brokered Windows Runtime Component (Let’s call thisBrokeredComponent)

  2.  Make updates to Class.cs (change file name if needed) to define the component.

  3.  Add a new project to the existing solution to create proxy/stub for this using the Templates -> Visual C++ -> Brokered Windows Runtime ProxyStub. (Let’s call this BrokeredProxyStub)

  4.  Add project reference on theBrokeredProxyStub project to depend on BrokeredComponent.

  5.  Build the entire solution to see if the build is successful.

  6.  Run regsvr32 to register theBrokeredProxyStub.dll found in $(SolutionDir)\[Debug|Release] folder.This step can be omitted if you perform steps described in NOTE.

  7.  Create a Windows Store C# App in the same solution.

  8.  Add a project reference on the C# App to depend on theBrokeredProxyStub project.

  9.  Update the AppxManifest to specify where the definition of the Brokered component is using this XML


      <Extensions>

        <ExtensionCategory="windows.activatableClass.inProcessServer">

          <InProcessServer>

            <Path>clrhost.dll</Path>

            <ActivatableClassActivatableClassId="[Fully Qualified Name of Brokered Component]"ThreadingModel="MTA">

              <ActivatableClassAttributeName="DesktopApplicationPath"Type="string"Value="[Path to location of Brokered Components and ProxyStub]" />

            </ActivatableClass>

          </InProcessServer>

        </Extension>

      </Extensions>

  10. Update code in the Windows Store C# App to use the brokered WinRT Component

  11. Run the Store App and see the code run

NOTE:

If you run Visual Studio as Administrator and mark the Proxy/Stub to register automatically using “project/properties/Linker/General/Register Output” of BrokeredProxyStub project (shown below) then things are 100% automatic. i.e. step 6 is no longer required.

http://msdn.micro
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft