diff --git a/csharp/simpleSendMessage/packages.config b/csharp/simpleSendMessage/packages.config
index 28f1902..14b61b1 100644
--- a/csharp/simpleSendMessage/packages.config
+++ b/csharp/simpleSendMessage/packages.config
@@ -7,12 +7,12 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/csharp/simpleSendMessage/simpleSendMessage.csproj b/csharp/simpleSendMessage/simpleSendMessage.csproj
index 7df0935..f301953 100644
--- a/csharp/simpleSendMessage/simpleSendMessage.csproj
+++ b/csharp/simpleSendMessage/simpleSendMessage.csproj
@@ -57,12 +57,16 @@
.\packages\Chronic.Signed.0.3.2\lib\net40\Chronic.dllTrue
-
- .\packages\Microsoft.Bot.Builder.3.3.2\lib\net46\Microsoft.Bot.Builder.dll
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Builder.dllTrue
-
- .\packages\Microsoft.Bot.Builder.3.3.2\lib\net46\Microsoft.Bot.Connector.dll
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Builder.Autofac.dll
+ True
+
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Connector.dllTrue
@@ -70,8 +74,8 @@
.\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.28\lib\net46\Microsoft.Diagnostics.Tracing.EventSource.dllTrue
-
- .\packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.2.206221351\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dll
+
+ packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.4.403061554\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dllTrue
@@ -87,8 +91,8 @@
True
-
- .\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll
+
+ packages\System.IdentityModel.Tokens.Jwt.4.0.4.403061554\lib\net45\System.IdentityModel.Tokens.Jwt.dllTrue
diff --git a/csharp/startNewDialog/Controllers/CustomWebAPIController.cs b/csharp/startNewDialog/Controllers/CustomWebAPIController.cs
index bef90e8..5f89b2c 100644
--- a/csharp/startNewDialog/Controllers/CustomWebAPIController.cs
+++ b/csharp/startNewDialog/Controllers/CustomWebAPIController.cs
@@ -19,7 +19,7 @@ public async Task SendMessage()
{
try
{
- if (!string.IsNullOrEmpty(ConversationStarter.resumptionCookie))
+ if (!string.IsNullOrEmpty(ConversationStarter.conversationReference))
{
await ConversationStarter.Resume(); //We don't need to wait for this, just want to start the interruption here
diff --git a/csharp/startNewDialog/ConversationStarter.cs b/csharp/startNewDialog/ConversationStarter.cs
index 5019a65..b014614 100644
--- a/csharp/startNewDialog/ConversationStarter.cs
+++ b/csharp/startNewDialog/ConversationStarter.cs
@@ -8,6 +8,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+using Newtonsoft.Json;
namespace startNewDialog
{
@@ -16,14 +17,16 @@ public class ConversationStarter
//Note: Of course you don't want this here. Eventually you will need to save this in some table
//Having this here as static variable means we can only remember one user :)
- public static string resumptionCookie;
+ public static string conversationReference;
//This will interrupt the conversation and send the user to SurveyDialog, then wait until that's done
public static async Task Resume()
{
- var message = ResumptionCookie.GZipDeserialize(resumptionCookie).GetMessage();
+ var asReference = JsonConvert.DeserializeObject(conversationReference);
+ var message = asReference.GetPostToBotMessage();
var client = new ConnectorClient(new Uri(message.ServiceUrl));
+ // Create a scope that can be used to work with state from bot framework.
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
{
var botData = scope.Resolve();
@@ -31,16 +34,16 @@ public static async Task Resume()
//This is our dialog stack
var stack = scope.Resolve();
-
+
//interrupt the stack. This means that we're stopping whatever conversation that is currently happening with the user
//Then adding this stack to run and once it's finished, we will be back to the original conversation
var dialog =new SurveyDialog();
- stack.Call(dialog.Void
-
- .\packages\Microsoft.Bot.Builder.3.3.2\lib\net46\Microsoft.Bot.Builder.dll
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Builder.dllTrue
-
- .\packages\Microsoft.Bot.Builder.3.3.2\lib\net46\Microsoft.Bot.Connector.dll
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Builder.Autofac.dll
+ True
+
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Connector.dllTrue
@@ -70,8 +74,8 @@
.\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.28\lib\net46\Microsoft.Diagnostics.Tracing.EventSource.dllTrue
-
- .\packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.2.206221351\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dll
+
+ packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.4.403061554\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dllTrue
@@ -87,8 +91,8 @@
True
-
- .\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll
+
+ packages\System.IdentityModel.Tokens.Jwt.4.0.4.403061554\lib\net45\System.IdentityModel.Tokens.Jwt.dllTrue
@@ -142,7 +146,9 @@
-
+
+ Designer
+
diff --git a/csharp/startNewDialogWithPrompt/Controllers/CustomWebAPIController.cs b/csharp/startNewDialogWithPrompt/Controllers/CustomWebAPIController.cs
index 415166e..ff549ee 100644
--- a/csharp/startNewDialogWithPrompt/Controllers/CustomWebAPIController.cs
+++ b/csharp/startNewDialogWithPrompt/Controllers/CustomWebAPIController.cs
@@ -19,7 +19,7 @@ public async Task SendMessage()
{
try
{
- if (!string.IsNullOrEmpty(ConversationStarter.resumptionCookie))
+ if (!string.IsNullOrEmpty(ConversationStarter.conversationReference))
{
await ConversationStarter.Resume(); //We don't need to wait for this, just want to start the interruption here
diff --git a/csharp/startNewDialogWithPrompt/ConversationStarter.cs b/csharp/startNewDialogWithPrompt/ConversationStarter.cs
index 4e2cf5b..a7ac073 100644
--- a/csharp/startNewDialogWithPrompt/ConversationStarter.cs
+++ b/csharp/startNewDialogWithPrompt/ConversationStarter.cs
@@ -8,6 +8,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+using Newtonsoft.Json;
namespace startNewDialogWithPrompt
{
@@ -15,12 +16,13 @@ public class ConversationStarter
{
//Note: Of course you don't want this here. Eventually you will need to save this in some table
//Having this here as static variable means we can only remember one user :)
- public static string resumptionCookie;
+ public static string conversationReference;
//This will interrupt the conversation and send the user to SurveyDialog, then wait until that's done
public static async Task Resume()
{
- var message = ResumptionCookie.GZipDeserialize(resumptionCookie).GetMessage();
+ var asReference = JsonConvert.DeserializeObject(conversationReference);
+ var message = asReference.GetPostToBotMessage();
var client = new ConnectorClient(new Uri(message.ServiceUrl));
@@ -33,7 +35,7 @@ public static async Task Resume()
//interrupt the stack
var dialog =new SurveyDialog();
stack.Call(dialog.Void(), null);
- await stack.PollAsync(CancellationToken.None);
+ await scope.Resolve().PollAsync(CancellationToken.None);
//flush dialog stack
await botData.FlushAsync(CancellationToken.None);
diff --git a/csharp/startNewDialogWithPrompt/RootDialog.cs b/csharp/startNewDialogWithPrompt/RootDialog.cs
index 0e01b7d..39244e5 100644
--- a/csharp/startNewDialogWithPrompt/RootDialog.cs
+++ b/csharp/startNewDialogWithPrompt/RootDialog.cs
@@ -12,6 +12,7 @@
using System.Xml.Linq;
using System.Threading;
using Newtonsoft.Json;
+using Microsoft.Bot.Builder.ConnectorEx;
namespace startNewDialogWithPrompt
{
@@ -30,7 +31,8 @@ public async Task StartAsync(IDialogContext context)
public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable result)
{
var message = await result;
- ConversationStarter.resumptionCookie = new ResumptionCookie(message).GZipSerialize();
+ var conversationReference = message.ToConversationReference();
+ ConversationStarter.conversationReference = JsonConvert.SerializeObject(conversationReference);
//Prepare the timer to simulate a background/asynchonous process
t = new Timer(new TimerCallback(timerEvent));
diff --git a/csharp/startNewDialogWithPrompt/packages.config b/csharp/startNewDialogWithPrompt/packages.config
index 28f1902..14b61b1 100644
--- a/csharp/startNewDialogWithPrompt/packages.config
+++ b/csharp/startNewDialogWithPrompt/packages.config
@@ -7,12 +7,12 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/csharp/startNewDialogWithPrompt/startNewDialogWithPrompt.csproj b/csharp/startNewDialogWithPrompt/startNewDialogWithPrompt.csproj
index f7c7349..43c9de1 100644
--- a/csharp/startNewDialogWithPrompt/startNewDialogWithPrompt.csproj
+++ b/csharp/startNewDialogWithPrompt/startNewDialogWithPrompt.csproj
@@ -57,12 +57,16 @@
.\packages\Chronic.Signed.0.3.2\lib\net40\Chronic.dllTrue
-
- .\packages\Microsoft.Bot.Builder.3.3.2\lib\net46\Microsoft.Bot.Builder.dll
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Builder.dllTrue
-
- .\packages\Microsoft.Bot.Builder.3.3.2\lib\net46\Microsoft.Bot.Connector.dll
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Builder.Autofac.dll
+ True
+
+
+ packages\Microsoft.Bot.Builder.3.9.0.0\lib\net46\Microsoft.Bot.Connector.dllTrue
@@ -70,8 +74,8 @@
.\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.28\lib\net46\Microsoft.Diagnostics.Tracing.EventSource.dllTrue
-
- .\packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.2.206221351\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dll
+
+ packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.4.403061554\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dllTrue
@@ -87,8 +91,8 @@
True
-
- .\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll
+
+ packages\System.IdentityModel.Tokens.Jwt.4.0.4.403061554\lib\net45\System.IdentityModel.Tokens.Jwt.dllTrue
@@ -142,7 +146,9 @@
-
+
+ Designer
+