Resolve the “‘Microsoft.Advertising.WinRT.UI.winmd’ contains duplicate types names”

Hi everybody,

I recently had an issue with the Microsoft Advertising SDK for WinRT.
I can’t compile without an error  (I found a tip – remove reference/compile/add reference/compile – but I can’t compile for making an app package).

The famous error is :

error APPX1712: The .winmd file ‘Microsoft.Advertising.WinRT.UI.winmd’ contains duplicate type names. Type ‘Microsoft.Advertising.WinRT.UI.AdControl’ is already registered with the in-process server ‘CLRHost.dll’.

1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(803,9): error APPX1712: The .winmd file ‘Microsoft.Advertising.WinRT.UI.winmd’ contains duplicate type names. Type ‘Microsoft.Advertising.WinRT.UI.XamlAdControl_XamlTypeInfo.XamlMetaDataProvider’ is already registered with the in-process server ‘CLRHost.dll’.

What the hell is ? It’s just a bogous statment, my project is maybe not typical : I use some library, and it seems the compiler does not like that.

HOW TO RESOLVE ?

I found a lot of posts on The Internet and non solve this issue. I spent a lot of time to find this :

1. Open with notepad the SDKManifest.xml in C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSAdvertisingXaml\6.1\SDKManifest.xml with administrator rights 
2. Edit this line   <File Reference = “Microsoft.Advertising.WinRT.UI.winmd” >
3 .Modify by <File Reference = “Microsoft.Advertising.WinRT.UI.winmd” Implementation=”Microsoft.Advertising.WinRT.UI.winmd” >
4. Recompile  and enjoy

That’s all, everything works perfect after that 😉

EDIT

Unfortunately, this works but the certification kit fails with that stuff (I mean advertising load in the DLL).

How to do : I referenced the SDK in the EXE, and Loaded in the DLL by Reflection the Type (Microsoft.Advertising.WinRT.UI.AdControl) referenced in the EXE.
Just a crappy stuff because of a bogus SDK : but it works and certification kit is happy !

Stephane

 

This entry was posted in C++ CX, WinRT. Bookmark the permalink.
  • Vijay

    Hi,

    I am getting following error when added new ads SDK(.0.7 version) from following link.
    https://visualstudiogallery.msdn.microsoft.com/229b7858-2c6a-4073-886e-cbb79e851211

    When compiling the project following errors I am facing. Pointers to kind of problem will be helpful for me.

    Error 103 error APPX1713: To ensure the correct metadata resolution, the type ‘r’ contained in .winmd file ‘Microsoft.Advertising.winmd’ should be located in ‘Microsoft.Advertising.WinRT.UI.winmd’. C:Program Files (x86)MSBuildMicrosoftVisualStudiov12.0AppxPackageMicrosoft.AppXPackage.Targets 1356 9 PreschoolGames.Windows

    Error 132 error APPX1713: To ensure the correct metadata resolution, the type ‘Microsoft.Advertising.WinRT.UI.PointerMoveEventArgs’ contained in .winmd file ‘Microsoft.Advertising.winmd’ should be located in ‘Microsoft.Advertising.WinRT.UI.winmd’. C:Program Files (x86)MSBuildMicrosoftVisualStudiov12.0AppxPackageMicrosoft.AppXPackage.Targets 1356 9 PreschoolGames.Windows

    Thanks,
    Vijay