IIS 8.5 Win 8.1 pro localHost无法正常工作

时间:2015-01-14 22:42:19

标签: iis visual-studio-2013 sql-server-2012 iis-8.5

我已经研究了几天而没有找到答案。我已经使用了google和Stack以及MDSN,所以我终于认为是时候提问了。我是一名新开发人员,我完成了第一次任务,我的计算机死了。我得到了Win 8.1 pro和IIS 8.5,现在我的任务是使用SQL 2012进行工作。我有它所以我可以将本地主机加载到应用程序的第一页,这是一个登录,然后当我使用Visual进行debuging时我开始登录后的工作室 第一次调用db就出现了

mscorlib.dll中出现“System.ServiceModel.ProtocolException”类型的异常,但未在用户代码中处理

其他信息:远程服务器返回了意外响应:(405)方法不允许。 然后我再次收到相同的消息,然后它将我发送到错误页面。

我是一名IIS新手,但我已确保IUSER拥有正确的授权,并且我已检查了所有web.configs以及applicationHost文件。这必须是一个IIS问题,我已经提出但如果有人告诉我我错了并纠正了我会很高兴。谢谢您的帮助。

代码示例

首次调用db,弹出第一个错误

MYapp.GlobalDataService.GlobalDataServiceClient gdc = new Myapp.Proxy.GlobalDataService.GlobalDataServiceClient();

ReadLogosResult result = gdc.GetLogos(_customerId,region_id,branch_id);

    if (result != null)
    {
        logoContent = result.Logo;
    }

这是在点击登录后         public static int GetUserId(IIdentity contextIdentity)         {             FormsIdentity identity = contextIdentity as FormsIdentity;

        if (identity == null)
        {
            throw new ApplicationException("cannot cast context identity to FormsIdentity type");
        }

        return Convert.ToInt32(identity.Ticket.UserData.Split(';')[0]);
    }

然后这个             for(int i = 0; i< ContextKeys.Length; i ++)             {                 string ContextKey = ContextKeys [i];                 if(ContextKey ==“appErr”)                 {                     obj =(Exception)HttpContext.Current.Application [“appErr”];                     HttpContext.Current.Application.Remove( “appErr”);                 }                 if(ContextKey ==“userId”)                 {                     user =(int)HttpContext.Current.Application [“userId”];                     HttpContext.Current.Application.Remove( “用户id”);                 }             } errors out对象引用未设置为对象的实例 然后转到我们的客户错误页面

1 个答案:

答案 0 :(得分:0)

我明白了。我需要在WCF中安装HTTPActivation。

相关问题