[尝试使用Microsoft商店服务SDK https://docs.microsoft.com/en-us/windows/uwp/monetize/microsoft-store-services-sdk?redirectedfrom=MSDN时,我可以在本地很好地运行代码,但是当将其作为AppX构建并打包到构建服务器上,然后将其部署到计算机上时,我得到以下异常:
Unhandled exception (Exception message: Method 'StoreServicesExperimentVariation.GetCachedVariationAsync(string)' from assembly 'Microsoft.Services.Store.Engagement' was not included in compilation, but was referenced in InsiderRingDebugService.<RunExperimentAsync>d__4.MoveNext(). There may have been a missing assembly, or a dependency on a more recent Windows SDK release.) App.xaml.cs 941
有人可以提供一些建议,为什么会这样?我注意到这是一个框架程序包,它似乎确实存在于我的WindowsApps目录中。谢谢。
编辑:为澄清起见,我遵循链接的文档上的“通过nuget安装”和“将程序集引用添加到您的项目中”的说明
更新:必须在核心项目和UWP项目中引用。现在可以使用!