locked
Problem distributing Metro app that references WinRT C++ dll

    Question

  • Hi,

    My C# app is referencing a C++ WinRT Component DLL and I'm trying to run it on a non-developer test machine. The app does not run unless I install VS 11/SDK. Is there a redistributable required for C++ Component dlls?

    Thanks

    Thursday, April 19, 2012 6:01 PM

Answers

All replies

  • This is by-design.  You must have a developer license in order to side-load Metro-style applications.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Thursday, April 19, 2012 8:13 PM
    Moderator
  • Hi Matt,

    I work with Xiao. The problem is this -

    - We create a metro app which references a C++ Winrt dll on a dev machine and create an AppPackage (thru VS11 menu Project -> Store -> Create App Package menu)

    - We deploy the app package on a clean Win8 machine thru the "powershell" tool and after running "Show-WindowsDeveloperLicenseRegistration" and then running the bat file of the app package.

    The app runs if the app does NOT contain the Winrt C++ dll reference. Installing the "Remote Tools for Visual Studio 11 Beta" (link below) does not help either. If I install the VS11 and SDK then the app runs. It looks like there is some redistributable needed if the app has C++ dll.

    (http://msdn.microsoft.com/en-us/windows/apps/br229516)

    Friday, April 20, 2012 6:24 PM
  • You might try running DEPENDS on the c++ dll on both the working and non-working machine to see which DLLs are missing.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Friday, April 20, 2012 7:00 PM
    Moderator
  • I do not have the machine in the that state now, but I had already done that. In my recollection, in the non working case, the dll shows missing dependency on vccorlib110.dll, msvcp110.dll, msvcr110.dll and few others. Its really hard to tell because DEPENDS does not really work well on Win8 to show exactly what is missing, a lot of yellow icons.
    Friday, April 20, 2012 8:57 PM
  • These files are in the Microsoft.VCLibs.110 app package that you should have a PackageDependency on in your AppxManifest.xml file.

    I'm not sure how this dependent package is intended to be distributed for testing. I discussed this with one of our C++ specialists and he will look into it.

    Since this is about the C++ side of you Metro style app and not the C# side I'll move the post into that forum for you.

    --Rob

    Friday, April 20, 2012 9:22 PM
    Owner
  • Now that I moved this for you, the problem may be with the C# app package. Make sure that it has the PackageDependency for the C++ libs in it. If not, then add the following:

    <Dependencies>
        <PackageDependency Name="Microsoft.VCLibs.110" MinVersion="11.0.0.0" />
    </Dependencies>
    

    This is automatically added to C++ projects, but isn't generally needed for C# projects.

    --Rob

    Friday, April 20, 2012 9:28 PM
    Owner
  • Yes, either add a reference to the C++ project, or to "Microsoft Visual C++ Runtime Package" which you'll find in the Reference Manager under Windows\Core\Extensions.

    -Steve

    Friday, April 20, 2012 9:48 PM
    Moderator
  • Adding a reference to the above mentioned package causes this compile error

    3>C:\views\Metro\MainPage.xaml.cs(581,49,581,59): error CS0433: The type 'Windows.UI.Xaml.GridLength' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\Microsoft.VCLibs\11.0\References\CommonConfiguration\neutral\platform.winmd' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.UI.Xaml.dll'

    3>C:\views\Metro\MainPage.xaml.cs(581,45,581,62): error CS0029: Cannot implicitly convert type 'Windows.UI.Xaml.GridLength [c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\Microsoft.VCLibs\11.0\References\CommonConfiguration\neutral\platform.winmd]' to 'Windows.UI.Xaml.GridLength [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.UI.Xaml.dll]'

    Sunday, April 22, 2012 12:11 AM
  • Can you send me a repro? Firstname.Lastname @ microsoft.com
    Wednesday, April 25, 2012 12:09 AM
    Moderator
  • I have a similar problem here. I have a c# project which dynamically loading a c++ component. After I add <Dependencies> for the c++ dll, the c# project cannot be deployed any more. If I take out the <Dependencies> for the c++ dll, the app certification kit test will fail.
    Thursday, May 31, 2012 12:34 AM