2016-11-09 368 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. 上传你的代码,新的实例。

这应该是神奇的。

另请注意,我已删除实例的应用程序计划。

请对任何疑问留言。