【问题标题】:C# Api Last.FM this is error?C# Api Last.FM 这是错误吗?
【发布时间】:2017-06-22 18:47:28
【问题描述】:

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

我尝试使用 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!
    }

我做错了什么?

【问题讨论】:

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


    【解决方案1】:

    你试过了吗?

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

    此问题的最可能原因是对属性或 ToString 方法的隐式评估导致 CLR 评估线程出现问题。要验证这一点,请关闭隐式评估。

    • 工具 -> 选项
    • 调试
    • 取消选中“启用属性评估和 其他隐式函数调用”

    然后重新启动你的场景,看看它是否有效。”

    【讨论】:

    • 感谢您的回答,但它并没有改变任何东西。变量有值,但我收到此错误,我认为代码有问题。
    猜你喜欢
    • 2016-04-01
    • 2014-04-20
    • 2011-03-09
    • 2021-01-05
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 2015-03-10
    • 1970-01-01
    相关资源
    最近更新 更多