久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='jp0oE'></bdo><ul id='jp0oE'></ul>

      <legend id='jp0oE'><style id='jp0oE'><dir id='jp0oE'><q id='jp0oE'></q></dir></style></legend>
    1. <i id='jp0oE'><tr id='jp0oE'><dt id='jp0oE'><q id='jp0oE'><span id='jp0oE'><b id='jp0oE'><form id='jp0oE'><ins id='jp0oE'></ins><ul id='jp0oE'></ul><sub id='jp0oE'></sub></form><legend id='jp0oE'></legend><bdo id='jp0oE'><pre id='jp0oE'><center id='jp0oE'></center></pre></bdo></b><th id='jp0oE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jp0oE'><tfoot id='jp0oE'></tfoot><dl id='jp0oE'><fieldset id='jp0oE'></fieldset></dl></div>

      <small id='jp0oE'></small><noframes id='jp0oE'>

        <tfoot id='jp0oE'></tfoot>

        無法使用 Google Calendar API 加載 System.Threading.Task

        Cannot load System.Threading.Tasks assembly, using Google Calendar API(無法使用 Google Calendar API 加載 System.Threading.Tasks 程序集)

            <tbody id='bNcaM'></tbody>

            • <i id='bNcaM'><tr id='bNcaM'><dt id='bNcaM'><q id='bNcaM'><span id='bNcaM'><b id='bNcaM'><form id='bNcaM'><ins id='bNcaM'></ins><ul id='bNcaM'></ul><sub id='bNcaM'></sub></form><legend id='bNcaM'></legend><bdo id='bNcaM'><pre id='bNcaM'><center id='bNcaM'></center></pre></bdo></b><th id='bNcaM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bNcaM'><tfoot id='bNcaM'></tfoot><dl id='bNcaM'><fieldset id='bNcaM'></fieldset></dl></div>

              • <bdo id='bNcaM'></bdo><ul id='bNcaM'></ul>

                  <small id='bNcaM'></small><noframes id='bNcaM'>

                  <legend id='bNcaM'><style id='bNcaM'><dir id='bNcaM'><q id='bNcaM'></q></dir></style></legend>
                  <tfoot id='bNcaM'></tfoot>
                  本文介紹了無法使用 Google Calendar API 加載 System.Threading.Tasks 程序集的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  非常感謝 Sam Leach

                  Huge thank to Sam Leach

                  這是我的工作 app.config 文件的示例:

                  Here is a sample of my working app.config file:

                  <configuration>
                         ...
                      <runtime>
                          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                              <dependentAssembly>
                                  <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
                                  <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0"/>
                              </dependentAssembly>
                              <dependentAssembly>
                                  <assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
                                  <bindingRedirect oldVersion="0.0.0.0-2.1.10.0" newVersion="2.1.10.0"/>
                              </dependentAssembly>
                              <dependentAssembly>
                                  <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
                                  <bindingRedirect oldVersion="0.0.0.0-2.1.10.0" newVersion="2.1.10.0"/>
                              </dependentAssembly>
                          </assemblyBinding>
                      </runtime>
                  </configuration>
                  

                  我還發現 來源

                  原始問題在該行下方.

                  我正在使用 .NET 4.0 框架,根據我的研究,我知道不再需要 System.Threading.Tasks 程序集(因為它是自動包含的).我錯了嗎?

                  I am using the .NET 4.0 Framework and from my research I know that the System.Threading.Tasks assembly is no longer needed (because it's included automatically). Am I wrong about this?

                  如果我是對的,我現在很確定會引發錯誤,因為 google-api-dotnet-client 的開發人員使用的 System.Threading.Tasks 版本與 Visual Studio 2010 使用的版本不同.

                  If I am right, I am now pretty sure that the error is raised because the version of System.Threading.Tasks used by the developers of the google-api-dotnet-client and the one used by Visual Studio 2010 are different.

                  我注意到當我刪除一些行時檢查我的應用程序的行為.

                  I noticed that when inspecting the behavior of my app when I remove some lines.

                  這些臺詞出來了:

                  gcal = new CalendarService(new BaseClientService.Initializer()
                  {
                      Authenticator = auth,
                      ApplicationName = APP_NAME,
                  });
                  

                  所以,我的新問題是:

                  有沒有辦法在 VS2010 中強制使用一個特定版本的參考程序集?

                  Is there a way to force the usage of one specific version of a reference assembly in VS2010 ?

                  感謝您幫助我,我相信它會幫助很多人,因為 google-calendar-api-v3 的文檔記錄不充分.

                  Thank you for helping me, I am sure it will help lots of people because the google-calendar-api-v3 is badly documented.

                  親切的問候,布魯諾.

                  我的問題是我無法通過 VisualStudio 訪問 Google API 即服務.

                  My problem is that I can't get access to the Google API as a service through VisualStudio.

                  我收到此錯誤:

                  L'exception System.IO.FileLoadException n'a pas été gérée
                    Message=Impossible de charger le fichier ou l'assembly 'System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
                    Source=MVMA
                    FileName=System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
                    FusionLog==== Informations d'état de liaison préalable ===
                  JRN?: utilisateur = MODALrbo
                  JRN?: DisplayName = System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
                   (Fully-specified)
                  JRN?: Appbase = file:///C:/Users/brbo/Documents/Visual Studio 2010/Projects/MVMA-V5.0 (With Gantt)/MVMA/bin/Debug/
                  JRN?: PrivatePath initial = NULL
                  Assembly appelant?: Google.Apis, Version=1.4.0.28227, Culture=neutral, PublicKeyToken=null.
                  ===
                  JRN?: cette liaison démarre dans le contexte de chargement de default.
                  JRN?: utilisation du fichier de configuration de l'application?: C:UsersrboDocumentsVisual Studio 2010ProjectsMVMA-V5.0 (With Gantt)MVMAinDebugMVMA.vshost.exe.Config
                  JRN?: utilisation du fichier de configuration d'h?te?: 
                  JRN?: utilisation du fichier de configuration de l'ordinateur à partir de C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
                  JRN?: référence post-stratégie?: System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
                  JRN?: tentative de téléchargement de la nouvelle URL file:///C:/Users/brbo/Documents/Visual Studio 2010/Projects/MVMA-V5.0 (With Gantt)/MVMA/bin/Debug/System.Threading.Tasks.DLL.
                  AVT?: la comparaison du nom de l'assembly a entra?né l'incompatibilité?: Version principale
                  ERR?: impossible de terminer l'installation de l'assembly (hr = 0x80131040). Détection terminée.
                  
                    StackTrace:
                     à MVMA.Classes.GoogleCalendar.BuildCalendarService()
                     à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
                     à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
                     à System.Threading.ThreadHelper.ThreadStart()
                  

                  這是我的類(相同的命名空間),它嘗試使用 Json Web 令牌連接到 Google Calendar API v3:

                  And here is my classes (same namespace) which tries to connect to the Google Calendar API v3 using Json Web Tokens:

                  public class GoogleCalendar
                  {
                  
                      // Cha?nes d'accès aux services Google
                      public const string APP_NAME = "HIDDEN";
                      public const string CLIENT_ID = "HIDDEN";
                      public const string CLIENT_SECRET = "HIDDEN";
                      public const string SERVICE_CLIENT_ID = "HIDDEN";
                      public const string EMAIL_ADDRESS = "HIDDEN";
                      public const string PUB_KEY = "HIDDEN";
                      public const string PRIV_KEY_PATH = @"C:MVMAHIDDEN-privatekey.p12";
                      public const string PRIV_KEY_SECRET = "notasecret";
                      public const string SIMPLE_API_KEY = "HIDDEN";
                      public const string SCOPE_CALENDAR = "https://www.googleapis.com/auth/calendar";
                      public const string SCOPE_CALENDAR_READONLY = "https://www.googleapis.com/auth/calendar.readonly";
                  
                      private static CalendarService gcal;
                  
                      public static void ImportFromMVMA()
                      {
                          Thread yat = new Thread(new ThreadStart(BuildCalendarService));
                          yat.Start();
                      }
                  
                      // Permet de récupérer le service calendrier
                      // Define the method that receives a callback when the results are available.
                      private static void BuildCalendarService() {
                  
                          var certificate = new X509Certificate2(PRIV_KEY_PATH, PRIV_KEY_SECRET, X509KeyStorageFlags.Exportable);
                          var privateKey = certificate.Export(X509ContentType.Cert);
                  
                          var provider = new AssertionFlowClient(GoogleAuthenticationServer.Description, certificate)
                          {
                              ServiceAccountId = EMAIL_ADDRESS,
                              Scope = SCOPE_CALENDAR
                          };
                  
                          var auth = new OAuth2Authenticator<AssertionFlowClient>(provider, AssertionFlowClient.GetState);
                  
                          gcal = new CalendarService(new BaseClientService.Initializer()
                                          {
                                              Authenticator = auth,
                                              ApplicationName = APP_NAME,
                                          });
                      }
                  }
                  
                  public enum JwtHashAlgorithm
                  {
                      RS256,
                      HS384,
                      HS512
                  }
                  
                  public class JsonWebToken
                  {
                  
                  
                      private static Dictionary<JwtHashAlgorithm, Func<byte[], byte[], byte[]>> HashAlgorithms;
                  
                      static JsonWebToken()
                      {
                          HashAlgorithms = new Dictionary<JwtHashAlgorithm, Func<byte[], byte[], byte[]>>
                          {
                              { JwtHashAlgorithm.RS256, (key, value) => { using (var sha = new HMACSHA256(key)) { return sha.ComputeHash(value); } } },
                              { JwtHashAlgorithm.HS384, (key, value) => { using (var sha = new HMACSHA384(key)) { return sha.ComputeHash(value); } } },
                              { JwtHashAlgorithm.HS512, (key, value) => { using (var sha = new HMACSHA512(key)) { return sha.ComputeHash(value); } } }
                          };
                      }
                  
                      public static string Encode(object payload, string key, JwtHashAlgorithm algorithm)
                      {
                          return Encode(payload, Encoding.UTF8.GetBytes(key), algorithm);
                      }
                  
                      public static string Encode(object payload, byte[] keyBytes, JwtHashAlgorithm algorithm)
                      {
                          var segments = new List<string>();
                          var header = new { alg = algorithm.ToString(), typ = "JWT" };
                  
                          byte[] headerBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(header, Formatting.None));
                          byte[] payloadBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(payload, Formatting.None));
                  
                          segments.Add(Base64UrlEncode(headerBytes));
                          segments.Add(Base64UrlEncode(payloadBytes));
                  
                          var stringToSign = string.Join(".", segments.ToArray());
                  
                          var bytesToSign = Encoding.UTF8.GetBytes(stringToSign);
                  
                          byte[] signature = HashAlgorithms[algorithm](keyBytes, bytesToSign);
                          segments.Add(Base64UrlEncode(signature));
                  
                          return string.Join(".", segments.ToArray());
                      }
                  
                      public static string Decode(string token, string key)
                      {
                          return Decode(token, key, true);
                      }
                  
                      public static string Decode(string token, string key, bool verify)
                      {
                          var parts = token.Split('.');
                          var header = parts[0];
                          var payload = parts[1];
                          byte[] crypto = Base64UrlDecode(parts[2]);
                  
                          var headerJson = Encoding.UTF8.GetString(Base64UrlDecode(header));
                          var headerData = JObject.Parse(headerJson);
                          var payloadJson = Encoding.UTF8.GetString(Base64UrlDecode(payload));
                          var payloadData = JObject.Parse(payloadJson);
                  
                          if (verify)
                          {
                              var bytesToSign = Encoding.UTF8.GetBytes(string.Concat(header, ".", payload));
                              var keyBytes = Encoding.UTF8.GetBytes(key);
                              var algorithm = (string)headerData["alg"];
                  
                              var signature = HashAlgorithms[GetHashAlgorithm(algorithm)](keyBytes, bytesToSign);
                              var decodedCrypto = Convert.ToBase64String(crypto);
                              var decodedSignature = Convert.ToBase64String(signature);
                  
                              if (decodedCrypto != decodedSignature)
                              {
                                  throw new ApplicationException(string.Format("Invalid signature. Expected {0} got {1}", decodedCrypto, decodedSignature));
                              }
                          }
                  
                          return payloadData.ToString();
                      }
                  
                      private static JwtHashAlgorithm GetHashAlgorithm(string algorithm)
                      {
                          switch (algorithm)
                          {
                              case "RS256": return JwtHashAlgorithm.RS256;
                              case "HS384": return JwtHashAlgorithm.HS384;
                              case "HS512": return JwtHashAlgorithm.HS512;
                              default: throw new InvalidOperationException("Algorithm not supported.");
                          }
                      }
                  
                      // from JWT spec
                      private static string Base64UrlEncode(byte[] input)
                      {
                          var output = Convert.ToBase64String(input);
                          output = output.Split('=')[0]; // Remove any trailing '='s
                          output = output.Replace('+', '-'); // 62nd char of encoding
                          output = output.Replace('/', '_'); // 63rd char of encoding
                          return output;
                      }
                  
                      // from JWT spec
                      private static byte[] Base64UrlDecode(string input)
                      {
                          var output = input;
                          output = output.Replace('-', '+'); // 62nd char of encoding
                          output = output.Replace('_', '/'); // 63rd char of encoding
                          switch (output.Length % 4) // Pad with trailing '='s
                          {
                              case 0: break; // No pad chars in this case
                              case 2: output += "=="; break; // Two pad chars
                              case 3: output += "="; break; // One pad char
                              default: throw new System.Exception("Illegal base64url string!");
                          }
                          var converted = Convert.FromBase64String(output); // Standard base64 decoder
                          return converted;
                      }
                  }
                  
                  public class GoogleJsonWebToken
                  {
                  
                      public static string GetAccessToken(string email, string certificateFilePath, string serviceScope)
                      {
                          var utc0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
                          var issueTime = DateTime.Now;
                  
                          var iat = (int)issueTime.Subtract(utc0).TotalSeconds;
                          var exp = (int)issueTime.AddMinutes(55).Subtract(utc0).TotalSeconds; // Expiration time is up to 1 hour, but lets play on safe side
                  
                          var payload = new
                          {
                              iss = email,
                              scope = serviceScope,
                              aud = "https://accounts.google.com/o/oauth2/token",
                              exp = exp,
                              iat = iat
                          };
                  
                          var certificate = new X509Certificate2(certificateFilePath, GoogleCalendar.PRIV_KEY_SECRET);
                  
                          var privateKey = certificate.Export(X509ContentType.Cert);
                  
                          return JsonWebToken.Encode(payload, privateKey, JwtHashAlgorithm.RS256);
                      }
                  }
                  

                  我不明白為什么我在 System.Threading.Tasks 程序集上有一個 FileLoadException.我嘗試向已經使用 Tasks 的應用程序添加新功能而沒有問題.此應用使用在不同線程中運行的 TabPage 對象.

                  I don't understand why I have a FileLoadException on the System.Threading.Tasks assembly. I try to add a new functionality to an application which already use Tasks without problems. This app uses TabPage objects which run in different threads.

                  推薦答案

                  刪除所有對 System.Threading.Tasks 的引用,然后從您使用的任何 .NET 版本中添加一個(.NET4.0).

                  Remove all references to System.Threading.Tasks and then add in the one from whatever .NET version you are using (.NET 4.0).

                  Google Calendar API 可能使用不同版本的 .NET

                  The Google Calendar API might be using a different version of .NET

                  手動重定向程序集

                  您可以在 app.config 中指定要使用的程序集版本

                  You can specify which version of the assembly to use in your app.config

                    <dependentAssembly>
                      <assemblyIdentity name="someAssembly"
                        publicKeyToken="32ab4ba45e0a69a1"
                        culture="en-us" />
                  
                      <bindingRedirect oldVersion="7.0.0.0" newVersion="8.0.0.0" />
                    </dependentAssembly>
                  

                  這篇關于無法使用 Google Calendar API 加載 System.Threading.Tasks 程序集的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)

                    <small id='E3EqP'></small><noframes id='E3EqP'>

                      <bdo id='E3EqP'></bdo><ul id='E3EqP'></ul>

                        <tfoot id='E3EqP'></tfoot>
                          <tbody id='E3EqP'></tbody>
                          <i id='E3EqP'><tr id='E3EqP'><dt id='E3EqP'><q id='E3EqP'><span id='E3EqP'><b id='E3EqP'><form id='E3EqP'><ins id='E3EqP'></ins><ul id='E3EqP'></ul><sub id='E3EqP'></sub></form><legend id='E3EqP'></legend><bdo id='E3EqP'><pre id='E3EqP'><center id='E3EqP'></center></pre></bdo></b><th id='E3EqP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='E3EqP'><tfoot id='E3EqP'></tfoot><dl id='E3EqP'><fieldset id='E3EqP'></fieldset></dl></div>
                            <legend id='E3EqP'><style id='E3EqP'><dir id='E3EqP'><q id='E3EqP'></q></dir></style></legend>
                            主站蜘蛛池模板: 久久精品福利视频 | 国产亚洲精品一区二区三区 | 日韩久久在线 | 久久综合爱 | 国产精品自拍视频 | 夜夜骚 | 亚洲精品国产a久久久久久 午夜影院网站 | a久久久久久| 日韩一级在线 | 日本人和亚洲人zjzjhd | 午夜影院在线观看视频 | 91性高湖久久久久久久久_久久99 | 欧美日韩一区二区三区四区 | 欧美一a一片一级一片 | 黄色毛片在线看 | 91人人爽 | 激情的网站 | 国产 日韩 欧美 在线 | 亚洲精品久久久久久久久久吃药 | 国产精品国产成人国产三级 | 久久男人天堂 | 成人毛片视频免费 | 国产一区免费 | 国产精品久久久久久久久久 | 久久久tv| 99精品视频免费观看 | 国产91久久久久久 | 欧美精品一区二区三区蜜桃视频 | 日本涩涩视频 | 久久综合狠狠综合久久综合88 | 国产精品视频在线观看 | 国产精品日韩在线观看一区二区 | 综合久久综合久久 | 羞羞视频一区二区 | 亚洲国产黄色av | 国产成人aⅴ | 免费av在线网站 | 国产精品五区 | 国产欧美一区二区三区在线看蜜臀 | 亚洲视频自拍 | 伊人性伊人情综合网 |