1
votes

I have a windows store WPF desktop bridge app compiled to 4.6.1. I am going to give the app away free and allow for in app purchases. To do this I need to use the UWP API for the windows store service.

I am also using the new desktop bridge packaging app template.

I want to keep the UWP API separate from the WPF project, so I have created a serparate dll project for the UWP API. I reference System.Runtime.WindowsRuntime and Windows. Use basic code from the Store Sample.

I add a reference from the WPF app to the UWP dll.

As soon as I reference the UWP dll the desktop bridge packaging app will return 9805 Errors and 1 warning.

One of the errors (which is typical) is

The .winmd file 'Windows.winmd' contains type 'Windows.Gaming.Input.Gamepad'. The use of the Windows namespace is reserved.

The warning is

No implementation file was provided for the .winmd file 'OUTPUT DIRECTORY PATH\Windows.winmd'. To generate registration information in the app manifest, specify the 'Implementation' metadata on the .winmd reference item in the project file.

I get the same errors if I add the two references to the WPF directly (System.Runtime.WindowsRuntime and Windows) and remove the UWP dll.

Updated: Have confirmed this is a problem with Desktop Bridge by:

Creating a new WPF App project.
Creating a new Windows Application Packaging Project and configure it to include the WPF project.
Build the WPF project.
Create an appx package and perform WACK tests. All Okay.
Add a reference to the C:\Program Files (x86)\Windows Kits\10\UnionMetadata\winmd
Add a reference to the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
Build the WPF project.
Trying to build the Packaging Project results in 9805 errors.

Here is the blog that I was following: https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/

Anyone know what is going on?

The error messages come from the WACK tests

<TEST INDEX="54" NAME="Type name correctness" DESCRIPTION="Only system types can be in the Windows namespace and no types can be in the global namespace." EXECUTIONTIME="00h:00m:08s.46ms" OPTIONAL="FALSE">
    <MESSAGES>
      <MESSAGE TEXT="The Windows.ApplicationModel.StartupTaskState type in the Windows.winmd file is in the Windows namespace." />
      <MESSAGE TEXT="The Windows.ApplicationModel.PackageSignatureKind type in the Windows.winmd file is in the Windows namespace." />
      <MESSAGE TEXT="The Windows.ApplicationModel.PackageVersion type in the Windows.winmd file is in the Windows namespace." />

Anyone know how to get around it?

4
From the same question, you have solved it by update Visual Studio. - Jayden
Actually I don't think I have solved it. With the update I no longer get the long list of errors when its just a reference to the UWP API's. I will have to do a bit more experimenting, maybe make a fresh project and try again. - Haydn

4 Answers

0
votes

Visual studio updates were installed a few days ago.

I built a new wpf app project targetting 4.6.1 Add a new windows packaging project and configure it. I no longer get a long list of errors and the references seem to work. Both applications compile.

So I am unsure of what was going wrong before or why it is fixed.

0
votes

Using the Windows.Services.Store namespace in a desktop bridge application is not compatible with the Windows Application Packaging Project. When building the packaging project, it will perform WACK tests which will throw 9805 errors and stop the creation of the appx bundle.

Manually creating the package will still give you to 9805 errors if you perform the WACK tests. But at least you should have an appx you can submit to the store.

0
votes

Visual Studio update 15.5 includes an update to the desktop bridge packaging project that allows you to include UWP Api's.

0
votes

The Windows.winmd is not required in the output package, I'd suggest changing the reference property to CopyLocal=false.