andydavies
andydavies

Reputation: 3293

Bot Framework emulator not posting to localhost after renaming my solution (500 error)

I created a Web App Bot in Azure with a basic template, downloaded the files and tested it with no problems on localhost with the Bot Framework Emulator.

However, once I renamed the solution/project/namespaces from the default Microsoft.Bot.Samples.SimpleEchoBot to MyBotName, the Bot Emulator received 500 - Internal Server Error.

The solution builds and runs, and setting a breakpoint in the MessagesController shows that the Post method is never reached.

How do I fix this?

Upvotes: 1

Views: 446

Answers (1)

andydavies
andydavies

Reputation: 3293

A GET request to localhost:[PORT]/api/messages (open that url in the browser) reveals the error message Multiple types were found that match the controller named 'messages'. It was somehow finding both the old messages controller (Microsoft.Bot.Samples.SimpleEchoBot.MessagesController) and the new one (MyBotName.MessagesController).

Solution: delete the bin/ folder and re-build/run the project.

Upvotes: 2

Related Questions