Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Could not load type 'System.Dynamic.IDynamicMetaObjectProviderfrom assembly .......

$
0
0

I'm working with some portable class libraries. I have code working with Android. Unfortunately, I am getting the following error in my iPhone project when I call into the a PCL library. I am using Visual Studio 2013. My VS is running in my book camp partition under Parallels. The error occurs when I call the .GetStreamAsync method. I am really lost on what to look for to solve this. I've even gone so far as to add the HttpClient from nuget. This did not help at all. I'm looking for suggestions, so feel free. Thanks for any ideas.

Error: Could not load type 'System.Dynamic.IDynamicMetaObjectProvider' from assembly 'System.Dynamic.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Code: using System;
using System.Net.Http;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace PCLWebServices
{
public class Data
{
public Data()
{
}
async public Task GetData(string location)
{
string contents;
WeatherReport res = new WeatherReport();
try
{
string Url = String.Format("http://api.openweathermap.org/data/2.5/forecast/daily?q={0}&mode=json&units=imperial&cnt=14",
location.Trim());
HttpClient hc = new HttpClient();
var str = await hc.GetStreamAsync(Url);
contents = await (new StreamReader(str)).ReadToEndAsync();
res = JsonConvert.DeserializeObject(contents);
foreach (var item in res.list)
{
HttpClient hcImage = new HttpClient();
var url = String.Format("http://openweathermap.org/img/w/{0}.png", item.weather[0].icon).Replace("dd", "d");
item.weather[0].Image = await hcImage.GetByteArrayAsync(url);
}
}
catch (System.Exception sysExc)
{
// Do something to log this error.
throw;
}
return res;
}
}
}


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>