试图通过其访问权限不允许的方式来访问套接字 [英] An attempt was made to access a socket in a way forbidden by its access permissions
问题描述
我刚刚下载的C#SDK和ASP.NET MVC样本,修改了它与4.2.1的工作。 (web配置facebookSettings参数等),创建了我的Facebook应用程序,并试图运行它。点击Facebook的登录按钮 - 确定,输入凭据到Facebook的弹出 - 好吧,让我的应用程序访问 - OK,然后我得到这个错误:
System.Net.Sockets.SocketException:试图通过其访问权限不允许的方式来访问套接字66.220.146.47:443
块引用>VAR应用=新FacebookApp();
如果(app.Session == NULL)
{
//用户心不是登陆到Facebook
//它们发送到主页
返回RedirectToAction(「指数」);
}//从图形API的用户信息
动力箱= app.Api(/我); //抛出异常HERE
计算机[名字] = me.first_name;
计算机[姓氏] = me.last_name;TJE
应用
对象是OK,我认为(包含设置参数,可以session对象有访问令牌和我的Facebook用户ID等)我使用的地方发展地址
HTTP://myappdev.local
(设置为127.0.0.1
在主机文件)。相同的地址在我的Facebook应用程序设置中设置,也域myappdev.local
- 这可能是什么问题?我已经看到了使用本地主机的例子:1234
在一些教程解决方案解决......我的坏 - 我的防火墙被悄悄地从连接端口443上阻止国际空间站工作进程......我希望我至少节省的人从同样的错误:)
I just downloaded C# SDK and ASP.NET MVC sample, modified it to work with 4.2.1. (web config facebookSettings parameters etc.), created my Facebook application and tried to run it. Click to facebook login button - ok, entering credentials into facebook popup - ok, allowing access for my application - ok, and then I get this error:
System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 66.220.146.47:443
var app = new FacebookApp(); if (app.Session == null) { // The user isnt logged in to Facebook // send them to the home page return RedirectToAction("Index"); } // Get the user info from the Graph API dynamic me = app.Api("/me"); // EXCEPTION THROWN HERE ViewData["FirstName"] = me.first_name; ViewData["LastName"] = me.last_name;
Tje
app
object is OK I think (containing settings params, session object with access token and my facebook userid, etc.)I am using local development address
http://myappdev.local
(set to127.0.0.1
in hosts file). The same address is set in my facebook app settings, also domainmyappdev.local
- Can this be the problem? I have seen examples usinglocalhost:1234
in some tutorials.解决方案Solved... my bad - my firewall was "silently" blocking ISS worker process from connecting on port 443... I hope that at least I save somebody from the same mistake :)
这篇关于试图通过其访问权限不允许的方式来访问套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!