代码之家  ›  专栏  ›  技术社区  ›  northern_poodle

机器人程序框架,无法加密空属性

  •  3
  • northern_poodle  · 技术社区  · 7 年前

    无法加密Null属性。如果要加密属性,请为其指定默认值。

        at Microsoft.Bot.Connector.ErrorHandling.<HandleErrorAsync>d__2`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Connector.BotStateExtensions.<SetConversationDataAsync>d__9.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore.<Microsoft-Bot-Builder-Dialogs-Internals-IBotDataStore<Microsoft-Bot-Connector-BotData>-SaveAsync>d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore.<Save>d__10.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore.<Microsoft-Bot-Builder-Dialogs-Internals-IBotDataStore<Microsoft-Bot-Connector-BotData>-FlushAsync>d__5.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.BotDataBase`1.<FlushAsync>d__9.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.DialogTaskManagerBotDataLoader.<FlushAsync>d__12.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.SerializeByConversation.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Internals.LogPostToBot.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__6.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        at TransAlta.Trading.Bot.Controllers.MessagesController.<Post>d__0.MoveNext() in C:\Users\acodallo\Documents\Bots\TradingBot\TradingBot\Controllers\MessagesController.cs:line 28
    

    由于我没有更改代码,而且我今天早上使用它没有问题,我不太确定会发生什么。任何帮助都将不胜感激。

    更新:

    2) 大多数逻辑存在于我的LUIS对话框和其他特定对话框中,这些对话框根据意图启动:

    [LuisIntent("Power.Buy")]
    public async Task PowerTrade(IDialogContext context, IAwaitable<IMessageActivity>activity, LuisResult result)
    {            
      BaseTrade formState = BaseTrade.InitState(result);
      formState.PositionType = PositionType.Buy;           
    
      SetCommonFields(formState);
    
      var tradeFormDialog = new FormDialog<BaseTrade>(formState, _tradeCreationDelegate, FormOptions.PromptInStart);            
      context.Call(tradeFormDialog, TradeTypeSpecificsDialog);
    }
    

    BaseTrade模型:

    public enum PositionType
    {
        Buy, Sell, Swap              
    }
    
    public enum Unit
    {
        Mw,
        Mwh,
        Gj,
        Mmbtu
    }
    public enum Timezone
    {
        APT = 1,
        AST,
        CPT,
        CST,
        EPT,
        EST,
        GMT,
        MPT,
        MST,
        PPT,
        PST
    }
    
    [Serializable]
    public class BaseTrade
    {
    
        [Prompt("Position Type?")]
        public PositionType? PositionType;
    
        [Prompt("Who is the counterparty?")]
        public string Counterparty;         
    
        [Prompt("Start date?")]
        public DateTime StartDate;
    
        [Prompt("End date?")]
        public DateTime EndDate;
    
        public Timezone Timezone;
    
        [Prompt("Please enter the trade quantity")]
        public int? Quantity;
    
        public Unit? Unit;
    
        [Prompt("Price?")]
        public int? Price;
    
        public DateTime? TradeDate = new DateTime();
    
        public static IForm<BaseTrade> BuildForm()
        {
            return new FormBuilder<BaseTrade>().Message("OK, we are going to create a trade").Build();
        }
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   northern_poodle    7 年前

    事实证明,这是微软方面的一个问题。