2013-06-04 3 views
0

최근 트위터 프로필에 새로운 기능의 트위터를 배치하기 시작했습니다. Azure의 CRON 작업을 통해 호출되며 MVC 4 프로젝트에서 호스팅됩니다.Azure에서 TweetSharp?

나는 푸른 그것을 실행하려고 할 때, 나는 다음과 같은 오류 얻을 (그리고 기억, 그것은 잘 로컬로 작동)

:

[NetworkInformationException (0x5): Access is denied] 
    System.Net.NetworkInformation.SystemIPGlobalProperties.GetFixedInfo() +9059627 
    System.Net.NetworkInformation.SystemIPGlobalProperties.get_FixedInfo() +172 
    System.Net.NetworkInformation.SystemIPGlobalProperties.get_DomainName() +269 
    System.Net.CookieContainer..ctor() +121 
    Hammock.Web.WebQuery.AppendCookies(HttpWebRequest request) +242 
    Hammock.Web.WebQuery.SetRequestMeta(HttpWebRequest request) +147 
    Hammock.Web.WebQuery.HandleRequestMeta(WebRequest request) +146 
    Hammock.Web.WebQuery.BuildPostOrPutFormWebRequest(PostOrPut method, String url, Byte[]& content) +680 
    Hammock.Web.WebQuery.BuildPostOrPutWebRequest(PostOrPut method, String url, Byte[]& content) +168 
    Hammock.Web.WebQuery.ExecutePostOrPut(PostOrPut method, String url, WebException& exception) +181 
    Hammock.Web.WebQuery.Request(String url, WebException& exception) +252 
    Hammock.Authentication.OAuth.OAuthWebQuery.Request(String url, WebException& exception) +157 
    Hammock.RestClient.RequestImpl(RestRequest request) +943 
    Hammock.RestClient.Request(RestRequest request) +74 
    TweetSharp.TwitterService.WithHammockImpl(RestRequest request) +83 
    TweetSharp.TwitterService.WithHammock(WebMethod method, String path) +120 
    TweetSharp.TwitterService.SendTweet(SendTweetOptions options) +782 

나는 그것이 푸른하지 않는 포트를 사용하기 때문에 그것의 가정을 지원 또는 이와 유사한 것. 아니면 그렇지? 나는이 문제를 해결할 수있는 단서가 없으며, 웹을 검색 할 때 웹에서 찾을 수있는 도움이되지 못했습니다.

여기 내 코드가 있습니다. 당신이 볼 수 있듯이, 액세스 토큰과 비밀에 하드 코딩하고, 로컬 작업 (말했듯이) 그들은 :

var service = new TwitterService("qwdwqdqwd", "qwdwqdqwdqwd"); 
service.AuthenticateWith("qwdqwdqwdqwd", "qwdqwdqwdwqd"); 

var status = "Collaborative short story of the day: Blah"; 
var response = service.SendTweet(new SendTweetOptions() {Status = status}); //crash! 

문제는 무엇입니까?

답변

0

문제 자체가 해결되었습니다. 나는 사이트가 몇 주 동안 운영되도록했고 갑자기 계정에서 오는 트윗을 발견했다. CRON 작업은 매일 실행되었고 많은 오류 500 메시지가 있었지만 갑자기 (코드를 건드리지 않고) 모두 작동했습니다.

애저 (Azure) 팀이 변경 한 사항입니다.

1

프로젝트를 Azure Web Site 또는 Azure Cloud Service에서 실행합니까?

StackTrace가 주어지면 주변을 조금 파고 SystemIPGlobalProperties은 안전하지 않은 몇 가지 방법을 사용합니다. Using unsafe methods requires full trust :

Caution Code written using an unsafe context cannot be verified to be safe, so it will be executed only when the code is fully trusted. In other words, unsafe code cannot be executed in an untrusted environment

또한 시스템 구성 요소에 대한 낮은 수준의 액세스 권한 상승이 필요할 수 있습니다. Windows Azure 웹 사이트는 완전 신뢰를 지원하지 않으므로 Azure 웹 사이트에서이 코드를 실행할 수 없습니다.

클라우드 서비스를 실행하는 경우 make sure that your code runs in Full Trust입니다. 도움이된다면 run your code with elevated privileges. (csdef 파일의 runtime 요소)

+0

실제로 Azure 웹 사이트입니다. 그래서 제가 그 일을 위해 봉사하지 않으면 저에게는 희망이 없습니다. –

+0

클라우드 서비스를 사용해보십시오 - 클라우드 서비스가 작동하는 경우 해먹이 웹 요청을 실행하는 방식을 변경하거나 환경을보다 효율적으로 제어 할 수있는 클라우드 서비스를 사용해야한다고 생각합니다. – astaykov

관련 문제