1

Using the instructions from here: http://visualstudiogallery.msdn.microsoft.com/527286e4-b06a-4234-adde-d313c9c3c23e

Running Visual Studio 2013 as Admin with Update 2.

I create a C# BWRC project, TestBwrc. In Class.cs I add an int property that returns 1.

I add a new project to the solution, a C++ Brokered Windows ProxyStub called TestBwrc.Ps.

I add a reference to the TestBwrc project, and set project Linker properties to Register Output.

I then build the solution.

I add a new project to the solution, a C# blank windows store app, called TestBwrc.Client. I add a reference to the TestBwrc.Ps project. Solution builds with no errors or warnings.

In the App.xaml.cs OnLaunched method I add TestBwrc.Class c = new TestBwrc.Class(); Visual Studio complains "Cannot resolve symbol 'Class'" Solution builds with no errors or warnings.

Running the app throws an exception, TestBwrc.Class is not registered.

What am I missing?

Edit:

Also on TestBwrc.Client I added the Extensions tag to the app manifest with the ClassId of TestBwrc.Class and path Value of "..\Debug\TestBwrc.Ps"

Greg Gorman
  • 196
  • 1
  • 9

1 Answers1

0

The problem is the path Value of "..\Debug\TestBwrc.Ps" in the ActivateableClassAttribute as mentioned in my edit. Though %ProgramFiles% will be expanded, .. is not, nor is $(SolutionDir). So the for dev the only value that works is C:\dev\TestBwrc\Debug\TestBwrc.Ps

  <Extensions>
    <Extension Category="windows.activatableClass.inProcessServer">
      <InProcessServer>
        <Path>clrhost.dll</Path>
        <ActivatableClass ActivatableClassId="TestBwrc.Class" ThreadingModel="MTA">
          <ActivatableClassAttribute Name="DesktopApplicationPath" Type="string" Value="C:\dev\TestBwrc\Debug\TestBwrc.Ps" />
        </ActivatableClass>
      </InProcessServer>
    </Extension>
  </Extensions>
Greg Gorman
  • 196
  • 1
  • 9
  • How do you then deploy this to a machine? The path won't stay the same on the target device. This is the part I'm struggling with at the moment. Thanks for any advice. – Jason Anderson Nov 12 '14 at 18:28
  • Since these apps are "side loaded" by IT and not installed via the Windows Store, in our case we installed to a standardized location. I then wrote a console app which is used by the solution after successful compilation to change the paths based on Debug or Release build. – Greg Gorman Nov 13 '14 at 19:09
  • A more flexible solution would be to use WIX or some other installer and write a real install program to resolve the paths. – Greg Gorman Nov 13 '14 at 19:10
  • And there is something special to do if I want to deploy the app in a tablet device? I have tried all you have said and it runs in my windows machine but not in my WinRT tablet. – Fran_gg7 May 05 '15 at 09:02