UWP / C ++ / Windows运行时组件-无法加载文件或程序集'Microsoft.AppCenter.Analytics

问题描述 投票:0回答:1

我尝试在我的项目中添加App Center。我的项目具有结构:

  1. 空白应用程序(通用Windows)c ++(TestAppCenter)
  2. Windows运行时组件(通用窗口)C#(CheckCrashComponent)

enter image description here

我在项目(CheckCrashComponent)中添加了应用程序中心。 Get Started with UWP

enter image description here

我在项目(TestAppCenter)中将init如下所示:enter image description here

显示错误:

WinRT information: System.IO.FileNotFoundException: Could not load file or assembly 

'Microsoft.AppCenter.Analytics,版本= 0.0.0.0,文化=中性,PublicKeyToken =空'或其依赖项之一。系统找不到指定的文件。

enter image description here

我在goolge上进行了搜索,但没有找到解决方案。如果您遇到像我这样的问题,请告诉我在这种情况下我错了。非常感谢您!!

c# uwp visual-studio-app-center
1个回答
0
投票

请用下面的静态方法替换类方法。

public static void  InitAppCenter()
{
    AppCenter.Start("11e4a636-6fa0-43b3-b2ee-dfde1f83a24e", typeof(Analytics), typeof(Crashes));  
}

通话步骤

 TestAppCenterCore::CoreRuntime::InitAppCenter;
© www.soinside.com 2019 - 2024. All rights reserved.