无法在Xamarin Studio中为.NET包添加Microsoft Azure配置管理器库 [英] Can't add Microsoft Azure Configuration Manager library for .NET package in Xamarin Studio

查看:63
本文介绍了无法在Xamarin Studio中为.NET包添加Microsoft Azure配置管理器库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Microsoft .NET的Microsoft Azure配置管理器库提供的​​CloudConfigurationManager类来解析配置文件中的连接字符串.跳到教程,了解我在做什么.我将尽可能地使用Xamarin平台.我正在创建一个Android应用,我想使用Azure存储将两个字符串保存到表中.

I need to use the CloudConfigurationManager class that the Microsoft Azure Configuration Manager library for .NET provides to parse a connection string from a configuration file. Skip down to the "Parse the connection string" step of this tutorial to see what I'm doing. I'm following along as close as I can using the Xamarin platform. I'm creating an Android app that I want to save two strings to a table using Azure Storage.

当我尝试添加.NET的Microsoft Azure配置管理器库时,IDE Xamarin Studio告诉我,我正在尝试将此软件包安装到以"MonoAndroid,Version = v6.0"为目标的项目中,但是程序包不包含任何与该框架兼容的程序集引用或内容文件.

When I try to add the Microsoft Azure Configuration Manager Library for .NET, the IDE, Xamarin Studio, tells me I am trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework.

我还可以使用哪些其他类来完成本教程中的相同任务.

What other classes can I use to accomplish the same thing from the tutorial.

推荐答案

您会收到此错误,因为nuget库不是为Xamarin.Android设计的.如果要从设置中读取连接字符串,可以将其放在首选项中并在运行时读取它:

You are getting that error because the nuget library isn't designed for Xamarin.Android. If you want to read the connection string from settings you can put it in preferences and read it at runtime:

var prefs = PreferenceManager.GetDefaultSharedPreferences (context);
connectionString = prefs.GetString ("StorageConnectionString");

这篇关于无法在Xamarin Studio中为.NET包添加Microsoft Azure配置管理器库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆