简体   繁体   中英

Error compiling MVC 3 project after adding FacebookWebMvc Nuget Package

I added the FacebookWebMvc Nuget package to my MVC 3 Web Application project and then created the following controller:

public ActionResult FacebookLogOn(string returnUrl)
{
    if (!FacebookWebContext.Current.IsAuthenticated())
    {
        throw new Exception("Please log into facebook");
    }
}

When I try to compile, I get this error (with the FacebookWebContext highlighted as the source of the error):

The type 'Facebook.Web.FacebookWebContext' exists in both 'I:\sites\ICTOAD\packages\FacebookWeb.5.0.26.0\lib\net40\Facebook.Web.dll' and 'I:\sites\ICTOAD\packages\FacebookWeb.5.0.26.0\lib\net40\CodeContracts\Facebook.Web.Contracts.dll'

Just remove a reference to Facebook.Web.Contracts.dll from your project.

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