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 Non classé. Bookmark the permalink.

Comments are closed.