securecodeninja
securecodeninja

Reputation: 2515

Latest Project Template and Emulator for Bot Framework V3 throws 500 Internal Server Error

I created a project using the latest Bot Application Template (http://aka.ms/bf-bc-vstemplate)

I made sure that I installed the latest updates for Visual Studio 2015 (Community Edition) and the nuget packages following the exact steps in the Getting Started page (http://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html)

I also followed these steps since I'm testing it locally:

When working with the emulator with a bot running locally, you need

The Url for your bot set the localhost: pulled from the last step. Note: will need to add the path "/api/messages" to your URL when using the Bot Application template. Empty out the MicrosoftAppId field Empty out the MicrosoftAppPassword field

I did a very basic test against the latest emulator(https://aka.ms/bf-bc-emulator) after running the Bot App project in VS 2015. When I send a "Typing" activity inside the Emulator, I received "500 Internal Server Error { "message":"An error has occurred." }".

But, when I place a comment on the BotAuthentication annotation

//[BotAuthentication]

Sending a "Typing" activity inside the emulator sends a "200 OK" response. Unfortunately, when I type in a word like "Hello" in the emulator, I get the "500 Internal Server Error { "message":"An error has occurred." }".

Any idea why this is happening?

Take note, I did not make any code changes to the default project except placing a comment to the BotAuthentication annotation.

The version of the Emulator is 3.0.0.54

UPDATE: I see a Exception thrown: 'System.MissingMethodException' in mscorlib.dll in VS Output window after the emulator shows "500 Internal Server Error { "message":"An error has occurred." }".

UPDATE

So I tried the exact setup in a different machine (Windows 8.1) because the machine I was working on is Win10 Evaluation. Guess what, it worked like a charm...so I guess it's an OS issue then or the GAC got messed up?

Upvotes: 0

Views: 703

Answers (2)

Satheesh
Satheesh

Reputation: 902

I faced the same issue and i figure out the issue by putting a try Catch block in the Postmethod. The actual error pop

Error in resolving Bot Id

I simply add a web config entry to my bot as below and it started working

 <add key="BotId" value="your app id"></add>

Upvotes: 2

Bryan Hall
Bryan Hall

Reputation: 23

Check what versions you are using for the following NuGet packages:

  • Microsoft.Rest.ClientRuntime - 1.8.2
  • Newtonsoft.Json - 8.0.3
  • System.IdentityModel.Tokens.Jwt - 4.0.2.206221351

When I upgraded any of these to later versions, I see a 500 error when running in the emulator.

I also had to add the security information for my bot to Web.config.

<add key="BotId" value="<put your BotId here>" />
<add key="MicrosoftAppId" value="<put your AppId here>" />
<add key="MicrosoftAppPassword" value="<put your AppPassword here>" />

You will need to add the security info to the channel emulator.

Upvotes: 1

Related Questions