Skip to main content
 首页 » 编程设计

c#之带有 MonoDevelop 和 C# 的 twitter API

2024年02月23日17grandyang

我正在使用 MonoDevelop。我尝试使用 Twitterizer 和 tweetsharp,但都出现错误。 我的 MonoDevelop 版本是 2.8.2。当应用程序启动时,我收到以下错误。

Could not load 'Newtonsoft.Json' for registration. This could be due to an outdated assembly kept by the simulator, location: /Users/apple/Projects/test/test/bin/iPhoneSimulator/Debug/Newtonsoft.Json.dll

当我尝试访问 Twitter api 时出现以下错误

Could not load type 'System.Diagnostics.Trace' from assembly 'Hammock'.

请您参考如下方法:

Could not load 'Newtonsoft.Json' for registration. This could be due to an outdated assembly kept by the simulator

你的第一条错误消息让我觉得你在使用 MonoTouch,对吧?

如果是这样,那么您不能按原样使用 Newtonsoft.Json.dll。此程序集需要一些在 iOS 设备上无法实现的功能(例如动态运行时代码生成)。

有一个特殊的 Newtonsoft.Json.MonoTouch.dll 您可以使用的版本。确保从最新源构建它以获得所有修复。

i get the following error Could not load type 'System.Diagnostics.Trace' from assembly 'Hammock'.

此外,您不能(通常)重复使用使用不同框架版本编译的程序集,因为它可能包含 MonoTouch 基类库中不可用的类型。为避免这种情况,您应该从源代码构建代码或找到支持 MonoTouch 的程序集。