2016-11-09 52 views
1

我的bot在Azure中的實例中工作,但是當我嘗試將其上載到另一個實例時,它停止響應。獲得以下例外。找到相同類型的多個自定義屬性。 Bot框架中的c#異常

因此,我們從Bot框架中被拒絕。

InternalServerError 
{ 
    "message": "An error has occurred.", 
    "exceptionMessage": "Multiple custom attributes of the same type found.", 
    "exceptionType": "System.Reflection.AmbiguousMatchException", 
    "stackTrace": " at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)\r\n at Microsoft.Rest.ServiceClient`1.get_FrameworkVersion()\r\n at Microsoft.Rest.ServiceClient`1.SetDefaultUserAgentInfo()\r\n at Microsoft.Rest.ServiceClient`1.SetUserAgent(String productName, String version)\r\n at Microsoft.Rest.ServiceClient`1.InitializeHttpClient(HttpClientHandler httpClientHandler, DelegatingHandler[] handlers)\r\n at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, DelegatingHandler[] handlers)\r\n at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, String microsoftAppId, String microsoftAppPassword, DelegatingHandler[] handlers)\r\n at HoroscopeBot.MessagesController.<Post>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()" 
} 

回答

1

至於現在這個問題已經被張貼在GitHub,它似乎是唯一的解決辦法是刪除當前蔚藍的實例,並創建一個新的實例,並重新上傳你的代碼。 這個解決方法也適用於我和其他人。

要清楚,

  1. 刪除當前的蔚藍實例顯示錯誤。

  2. 創建另一個名稱的新實例(使用相同的名稱給問題的我。這工作了一段時間,但後來墜毀。)

  3. 上傳你的代碼,新的實例。

這應該是神奇的。

另請注意,我已刪除實例的應用程序計劃。

請對任何疑問留言。