首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure移动客户端引发.Ext错误

Azure移动客户端引发.Ext错误
EN

Stack Overflow用户
提问于 2017-07-09 15:26:41
回答 1查看 57关注 0票数 0

我知道这是人们多年来一直在处理的问题,应该解决折旧版本的问题,但我在这里。在这个看似简单的问题上花了比我更多的时间。

这是我的包文件夹

代码语言:javascript
复制
<packages>
  <package id="Com.Airbnb.Xamarin.Forms.Lottie" version="1.0.0.7" targetFramework="portable45-net45+win8+wp8" />
  <package id="HockeySDK.Xamarin" version="4.1.4" targetFramework="portable45-net45+win8+wp8" />
  <package id="Microsoft.Azure.Mobile.Client" version="3.1.0" targetFramework="portable45-net45+win8+wp8" />
  <package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8+wp8" />
  <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="portable45-net45+win8+wp8" />
  <package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="portable45-net45+win8+wp8" />
  <package id="Microsoft.Data.OData" version="5.8.2" targetFramework="portable45-net45+win8+wp8" />
  <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="portable45-net45+win8+wp8" />
  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="portable45-net45+win8+wp8" />
  <package id="System.Spatial" version="5.8.2" targetFramework="portable45-net45+win8+wp8" />
  <package id="UXDivers.Artina.Shared" version="2.0.52" targetFramework="portable45-net45+win8+wp8" />
  <package id="UXDivers.Artina.Shared.Base" version="2.0.52" targetFramework="portable45-net45+win8+wp8" />
  <package id="UXDivers.Effects" version="0.6.0" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarintvos10+xamarinwatchos10+xamarinios10" />
  <package id="Xam.Plugin.Connectivity" version="2.3.0" targetFramework="portable45-net45+win8+wp8" />
  <package id="Xamarin.FFImageLoading" version="2.2.9" targetFramework="portable45-net45+win8+wp8" />
  <package id="Xamarin.FFImageLoading.Forms" version="2.2.9" targetFramework="portable45-net45+win8+wp8" />
  <package id="Xamarin.FFImageLoading.Transformations" version="2.2.9" targetFramework="portable45-net45+win8+wp8" />
  <package id="Xamarin.Forms" version="2.3.4.247" targetFramework="portable45-net45+win8+wp8" />
</packages>

这是我的Droid MainActivity类

代码语言:javascript
复制
public class MainActivity : FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {

            // Changing to App's theme since we are OnCreate and we are ready to 
            // "hide" the splash
            base.Window.RequestFeature(WindowFeatures.ActionBar);
            base.SetTheme(Resource.Style.AppTheme);

            FormsAppCompatActivity.ToolbarResource = Resource.Layout.Toolbar;
            FormsAppCompatActivity.TabLayoutResource = Resource.Layout.Tabs;

            base.OnCreate(bundle);

            // Initialize Azure Mobile Apps
            CurrentPlatform.Init();

...
}
}

在我的云服务中我有这个

代码语言:javascript
复制
public AzureCloudService()
        {
            client = new MobileServiceClient("https://For-me-to-know.com");
        }

关于新MobileServceClient的实例化,我得到了这个错误

system.InvalidOperationException:未找到当前平台的Microsoft程序集。确保当前项目同时引用Microsoft.WindowsAzure.Mobile和以下特定于平台的程序集: Microsoft.WindowsAzure.Mobile.Ext。

编辑 @Bruce是的,我的机器人和iOs项目增加了移动客户端

我还运行了断点,它首先执行主活动,然后再尝试将上面的移动客户端固定下来。

EN

回答 1

Stack Overflow用户

发布于 2017-07-10 05:22:38

基于您的packages.config,这似乎是来自您的PCL项目。

因此,如果在Droid项目下插入了MobileServiceClient,则需要确保已安装了Droid项目的Azure移动客户端SDK NuGet包,如下所示:

此外,我注意到您在Droid MainActivity类中添加了MainActivity。我建议您检查CurrentPlatform.Init()调用是否在输入MobileServiceClient实例之前。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44998016

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档