Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Form Flow with SDK v-4 in .Net Core #4993

Closed
Souvik04 opened this issue Aug 23, 2018 · 10 comments

Comments

Projects
None yet
5 participants
@Souvik04
Copy link

commented Aug 23, 2018

Bot Info

  • SDK Platform: .Net Core 2.0
  • SDK Version: 4
  • Active Channels: DirectLine, Skype, Cortana
  • Deployment Environment: Azure

Issue Description

I am unable to use FormFlow in SDK v-4. FormFlow seems to be now part of Microsoft.Bot.Builder.Classic which is a .Net 4.6.1 library for SDK v-4. However, as per this link- https://github.com/Microsoft/botbuilder-dotnet/wiki/Using-Classic-V3-Dialogs-with-V4-SDK it is not supported in .Net Core.
I posted this issue on below link. The solution provided here did not work and the issue is now closed.
MicrosoftDocs/bot-docs#227
I have also raised this on Stackoverflow- https://stackoverflow.com/questions/51963724/using-formflow-dialog-in-bot-framework
but haven't got any response yet. Any help with this please?

Update-1

I got the exception details. System.Runtime.Serialization.SerializationException: Type 'System.RuntimeType' in Assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not marked as serializable.. Although my HelpForm class is marked with Serializable.

Also, looking at the metadata for FormFlow class it is not marked with Serializable attribute.

image

Code Example

Form implementation:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Classic.FormFlow;

namespace BotFrameworkDev.Forms
{
    [Serializable]
    public class HelpForm
    {
        public string FullName { get; set; }
        public string EmailID { get; set; }
        public string Question { get; set; }
        public DateTime BestTimeToContact { get; set; }
        public List<Priority> Priority { get; set; }
        public static IForm<HelpForm> BuildForm()
        {
            return new FormBuilder<HelpForm>()
                .Message("Please fill out the details as prompted.")
                .Build();
        }
    }

    public enum Priority
    {
        Low,
        Medium,
        High
    }
}

Calling the FormFlow within the OnTurn of Bot class:

public async Task OnTurn(ITurnContext context)
{
	if (context.Activity.Type == ActivityTypes.ConversationUpdate)
	{
		//some code
	}
	else if (context.Activity.Type == ActivityTypes.Message)
	{
		await Microsoft.Bot.Builder.Classic.Dialogs.Conversation.SendAsync(context, () => FormDialog.FromForm(HelpForm.BuildForm));
	}
}

Reproduction Steps

  1. Run the code in Visual Studio
  2. Use Bot Framework emulator to test

Expected Behavior

Get the Form Flow prompts from the bot in the chat window.

Actual Results

"Sorry, my bot code is having an issue" in the chat window.

@Souvik04 Souvik04 changed the title Using Form Flow in SDK v-4 Using Form Flow with SDK v-4 in .Net Core Aug 23, 2018

@jwiley84 jwiley84 self-assigned this Aug 23, 2018

@jwiley84

This comment has been minimized.

Copy link
Member

commented Aug 23, 2018

Investigating!

@Souvik04

This comment has been minimized.

Copy link
Author

commented Aug 27, 2018

@jwiley84 I tried using the Waterfall steps dialog to achieve something similar but it needs some tweaks and tricks to make it work similar to Form Flow dialog. Any update yet?

@jwiley84

This comment has been minimized.

Copy link
Member

commented Aug 27, 2018

Hi @Souvik04! I'm waiting for word from one of my coworkers this morning! I should have an update NLT this afternoon!

@Souvik04

This comment has been minimized.

Copy link
Author

commented Aug 28, 2018

@jwiley84 Ok, thanks.

@Souvik04

This comment has been minimized.

Copy link
Author

commented Aug 28, 2018

@jwiley84 I have added some more details.

@jwiley84

This comment has been minimized.

Copy link
Member

commented Aug 28, 2018

Hi @Souvik04!
My coworkers are still working on a workaround/ making .Classic work with ASP.Net Core.

@tomlm

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2018

You can't use classic in Asp.NET core.

@tomlm tomlm closed this Sep 15, 2018

@Souvik04

This comment has been minimized.

Copy link
Author

commented Sep 17, 2018

@tomlm What would be the alternate solution for using the Form flow dialog?

@Unders0n

This comment has been minimized.

Copy link

commented Nov 26, 2018

any updates? no formflow in v4?

@EricDahlvang

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.