Search code examples
asp.net-mvc-4asp.net-web-apitelegram-bottelegram-webhooksystem.web.http

after adding Telegram.Bot From nuget, MVC fails on compile


i'm using vs2012 and created a MVC4 project

i'm going to implement a webhook for telegram bot.

but after i added Telegram Bot Api from nuget, my projects not compiles fully and throws an exception like below:

Attempt by method 'System.Web.Http.HttpConfiguration..ctor(System.Web.Http.HttpRouteCollection)' to access method 'System.Web.Http.HttpConfiguration.DefaultFormatters()' failed.

i found some solutions on stackoverflow but they couldn't helped me. some one siad uninstall and install WebApiClient but it had no affects.


Solution

  • i just commented this code in Global.asax.cs and it's working truly...

    WebApiConfig.Register(GlobalConfiguration.Configuration);