Build error “error APPX1706:”

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

In a time of transition form .NET framework to .NET core, you might run into issues, which you never ha before.
This is the price for open source. Smile

For example, look at following error:

error APPX1706: The .winmd file 'Windows.Foundation.UniversalApiContract.winmd' contains type 'Windows.Networking.NetworkOperators.MobileBroadbandDeviceServiceCommandResult' outside its root namespace 'Windows.Foundation.UniversalApiContract'. Make sure that all public types appear under a common root namespace that matches the output file name.

You might get this in different type variations (in my case: 'Windows.Networking.NetworkOperators.MobileBroadbandDeviceServiceCommandResult' ), which of course does not have nothing to do with the error.

This error will probably make you crazy and it will not be easy to solve. To illustrate what has happened here, I created a simple solution with two projects.

image

Project ClassLibrary1 is a portably library, which targets following platforms:

"net46.app",
"uwp.10.0.app"
"dnxcore50.app"

Project TESTFx is UWP application, which references the ClassLibrary1 as project.

The error shown above (or similar) will pop up during build process, if the portable library has a direct reference to some WinRT assembly (or better to say to some ‘winmd’ file).

In my case this is ‘Windows.Foundation.UniversalApiContract’ as shown at the following picture:

image

Remove that reference and probably also the code, which requires it and error will dissapear.


Posted Jun 24 2016, 09:38 AM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.