2015-07-20 42 views
1

我怎樣才能使一個程序編碼在C#單片機上的Windows上,能夠在Linux上工作?我怎樣才能使一個程序編碼在C#單片機上的Windows上,能夠在Linux上工作?

如果我在linux上啓動我的程序,我會得到:http://pastebin.com/YdnAk7nD。 也許與我的代碼有問題:?

using System; 
using Tweetinvi; 
using System.Threading; 

namespace TwitterBot 
{ 
    class MainClass 
    { 
     public static void Main (string[] args) 
     { 
      Console.WriteLine ("Bot started"); 

      TwitterCredentials.SetCredentials("*****"); 

      var loggedUser = User.GetLoggedUser(); 
      var settings = loggedUser.GetAccountSettings(); 

      int i = 1; 
      int fails = 0; 
      while (true) { 
       var user = User.GetUserFromId (i); 
       i++; 

       if (user != null) { 
        loggedUser.FollowUser (user); 
        Console.WriteLine ("Now following: " + user.Name); 
       } else { 
        Console.WriteLine("Can not follow user with id: " + i); 
        fails++; 
       } 

       if (fails >= 100) { 
        fails = 0; 
        Console.WriteLine ("Sleep for 5 minutes"); 
        Thread.Sleep (1000 * 60 * 5); 
        Console.WriteLine ("Woken up after 5 minutes"); 

       } 
      } 

     } 
    } 
} 

回答

0

Tweetinvi應該在版本4.5之後與Mono一起工作。您能否檢查您安裝的Mono版本?

+0

在我的Linux上,我有:單聲道JIT編譯器版本4.0.2(Stable 4.0.2.5/c99aa0c Wed Jun 24 10:04:37 UTC 2015) – fipso100

相關問題