Manatee.Trello.RestSharp.RestSharpResponse 引发的异常
Exception Thrown by Manatee.Trello.RestSharp.RestSharpResponse
我刚刚在尝试使用 Manatee.Trello 时遇到异常。我试图创建一个 Func 是这样的:
var criteria = new List<string>
{
"(put a board ID here)"
};
var query = new Func<IEnumerable<Manatee.Trello.Member>, IEnumerable<Manatee.Trello.Board>>(
members =>
{
foreach (var member in members)
{
var selectedBoards = member.Boards.Where(b => criteria.Contains(b.Id, StringComparer.Ordinal));
boards.AddRange(selectedBoards); // Exception thrown here
}
return boards;
});
但是上面标记的行抛出这个异常:
System.TypeLoadException
{"Method 'get_StatusCode' in type 'Manatee.Trello.RestSharp.RestSharpResponse' from assembly 'Manatee.Trello.RestSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=783b036be1eaf5a7' does not have an implementation.":"Manatee.Trello.RestSharp.RestSharpResponse"}
我不确定这是我的代码做错了什么,还是我在使用 Manatee.Trello 设置我的项目时犯了某种设置错误,也许是 NuGet 包被加载了...
任何关于从哪里开始寻找的提示都将不胜感激。
这种情况已通过从 Manatee.Trello
中包含的 RestSharp 提供程序更改为 Manatee.Trello.WebApi
中的提供程序得到补救。正如我在 library's documentation:
中发现的
Manatee.Trello.RestSharp is backed by (you guessed it) RestSharp.
There have been some issues with the .Net 4.5+ versions, so it's
suggested you don't use this one unless you are using .Net 4.0 or
earlier.
确实,我正在使用.Net 4.5.2。
我刚刚在尝试使用 Manatee.Trello 时遇到异常。我试图创建一个 Func 是这样的:
var criteria = new List<string>
{
"(put a board ID here)"
};
var query = new Func<IEnumerable<Manatee.Trello.Member>, IEnumerable<Manatee.Trello.Board>>(
members =>
{
foreach (var member in members)
{
var selectedBoards = member.Boards.Where(b => criteria.Contains(b.Id, StringComparer.Ordinal));
boards.AddRange(selectedBoards); // Exception thrown here
}
return boards;
});
但是上面标记的行抛出这个异常:
System.TypeLoadException
{"Method 'get_StatusCode' in type 'Manatee.Trello.RestSharp.RestSharpResponse' from assembly 'Manatee.Trello.RestSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=783b036be1eaf5a7' does not have an implementation.":"Manatee.Trello.RestSharp.RestSharpResponse"}
我不确定这是我的代码做错了什么,还是我在使用 Manatee.Trello 设置我的项目时犯了某种设置错误,也许是 NuGet 包被加载了...
任何关于从哪里开始寻找的提示都将不胜感激。
这种情况已通过从 Manatee.Trello
中包含的 RestSharp 提供程序更改为 Manatee.Trello.WebApi
中的提供程序得到补救。正如我在 library's documentation:
Manatee.Trello.RestSharp is backed by (you guessed it) RestSharp. There have been some issues with the .Net 4.5+ versions, so it's suggested you don't use this one unless you are using .Net 4.0 or earlier.
确实,我正在使用.Net 4.5.2。