c# - C#Api Last.FM这是错误吗?

标签 c# api xamarin.forms last.fm audio

我正在编写我的小项目,我需要下载音乐专辑数据。

我尝试使用last.fm API,但遇到一个奇怪的错误:)

     public HelpLastFmItemSearch(string albumName)
    {
        //For test
        albumName = "Meteora";


      string _albumsSearchURL =  "http://ws.audioscrobbler.com/2.0/?method=album.search&album=" + albumName + "&api_key="+ Api.LastFMKeySingleton.Instance.getApiKey()+"&format=json";
      HttpClient albumSearchClient = new HttpClient();
      var jsonAlbumsSearch = albumSearchClient.GetStringAsync(_albumsSearchURL);
      var deserializeJsonAlbumsSearch = JsonConvert.DeserializeObject<dynamic>(jsonAlbumsSearch.Result);
      var deserializeJsonAlbumsSearchTest = JsonConvert.DeserializeObject<ViewHelp_Music.AddMusic.LastFm_Api.AlbumSearch.HelpLastFMJsonAlbumsSearch>(jsonAlbumsSearch.Result);
        //Testing !
        var _artistname = deserializeJsonAlbumsSearchTest.Results.Albummatches.Album[0].Artist;
        var _albumname = deserializeJsonAlbumsSearchTest.Results.Albummatches.Album[0].Name;


        string _albumInfoURL = "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=" + Api.LastFMKeySingleton.Instance.getApiKey() + "&artist=" + _artistname + "&album=" + _albumname + "&format=json";
        HttpClient albumInfoClient = new HttpClient();
        var jsonAlbumInfo = albumInfoClient.GetStringAsync(_albumInfoURL);
        var deserializeJsonAlbumInfo = JsonConvert.DeserializeObject<dynamic>(jsonAlbumInfo.Result);
        var deserializeJsonAlbumInfoTest = JsonConvert.DeserializeObject<ViewHelp_Music.AddMusic.LastFm_Api.AlbumInfo.HelpLastFMJsonAlbumInfo>(jsonAlbumInfo.Result);


        //////Do Poprawy!
    }

enter image description here

我究竟做错了什么?

最佳答案

你有试过吗

Function evaluation timed out when examining variables in debug/stepping through

The most likely cause of this problem is an implicit evaluation of a property or ToString method which causes an issue with the CLR evaluation thread. To verify this turn off implicit evaluation.

  • Tools -> Options
  • Debugging
  • Uncheck "Enable property evaluation and other implicit function calls"

Then restart your scenario and see if it works."

关于c# - C#Api Last.FM这是错误吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44696911/

相关文章:

c# - 在没有代码隐藏的情况下从aspx中的数据库参数动态添加<li>

c# - 如何使用 POSTMAN 发布字符串数组?

c# - 以编程方式使用相对布局设置 View 的背景 Xamarin 表单

c# - 显示页面几秒钟并导航到另一个页面

c# - 为什么在基类构造函数中设置时重写的 get-only 属性保持为 null?

c# - 为什么必须最后指定 new() 约束?

regex - Jax-RS 重载方法/路径执行顺序

javascript - JWPlayer 如何从 Javascript 更改字幕轨道?

javascript - Angular 2 和 google map API 的 typescript 逻辑问题

c# - Xamarin.Forms 中的 RowSpan 和 ColumnSpan