Can't add Microsoft Azure Configuration Manager library for .NET package in Xamarin Studio

泪湿孤枕 提交于 2019-12-12 02:53:48

问题


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.

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.


回答1:


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");



回答2:


You need to use the pre-release versions (currently 7.0.1-preview) of Azure Storage SDK. It supports using it in PCL projects and does not require Configuration Manager for PCL profiles either.

You should be able to add the same DLL to your platform specific project if you need the functionality there too.



来源:https://stackoverflow.com/questions/36633474/cant-add-microsoft-azure-configuration-manager-library-for-net-package-in-xama

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!