我有一個Windows應用程序,它可以訪問Google電子表格來創建電話簿。當我嘗試打開電話簿時,出現System.NotImplementedException: The method or operation is not implemented.
我不太確定爲什麼,因爲它似乎正在實施?訪問ServiceAccountCredential時發生NotImplementedException C#
這就是會被這個問題標記的第一點:
internal object FromCertificate(X509Certificate2 certificate)
{
throw new NotImplementedException(); //Error flags this line
}
這是第二次。據我所知,這部分沒有任何問題,但它仍然會標記異常。
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { "https://www.googleapis.com/auth/spreadsheets", "https://docs.google.com/feeds" }
}.FromCertificate(certificate));
任何建議將非常感激。我在C#中使用Visual Studio 2015.
我想補充爲什麼你的「第二點」的頹勢了一個例外:你'NotImplementedException'從你的方法冒泡回來,調試器從它被調用的地方通知你,當它返回到那裏。如果你處理(catch)它降低,它不會回升,除非你重新拋出(再次拋出) –