简体   繁体   中英

Twitter Helper class is not present in System.Web.Helpers

I am trying to use Asp .net Webpages for my site. I am following W3Schools' tutorial for this. I started with Empty Asp .net application project and added a cshtml page to it. After too many trouble I finally installed System.Web.Helpers package from nuget and it's working for GamerCard.

The problem is I am not able to use Twitter helpers at all. I am getting the following error when I use Twitter.Profile()

Compiler Error Message: CS0103: The name 'Twitter' does not exist in the current context

I used Object Browser to check the System.Web.Helpers assembly and to much of my surprise there was no Twitter class at all. I can see Facebook, GamerCard, Gravatar etc. classes, but no sign of Twitter there. Acc. to this page , Twitter class should be present there too.

Any idea what did I miss?

Found the answer on Codeplex project site of Asp.net. The issue mentioned here , stats that due to the retirement of Twitter API V1, the Twitter helper code was broken, hence Microsoft removed it from the Microsoft.Web.Helpers namespace completely. More info can be found in the issue text.

To use twitter helpers, the issue mentions a newer and more complex method which you can see here . Didn't try it yet, but I hope it'll work.

Thanks @gunr2171 for helping and pushing in the right direction :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM