简体   繁体   English

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

[英]IIS 8.5 Win 8.1 pro localHost not working

I have researched for days and not found an answer. 我研究了几天,却没有找到答案。 I have used both google and Stack and MDSN so I finally thought it is time to ask the question. 我曾经用过Google以及Stack和MDSN,所以我终于认为是时候问这个问题了。 I am a new developer I completed my first assignment and my computer died. 我是一名新开发人员,我完成了第一份作业,并且计算机坏了。 I got Win 8.1 pro and IIS 8.5 and now I am tasked with making that work with SQL 2012. I have it so I can load up the localhost to the first page of the app which is a login and then when I am debuging using Visual Studio after I start to log in the first call to the db this comes up 我有Win 8.1 Pro和IIS 8.5,现在我的任务是使它与SQL 2012一起使用。我拥有它,因此可以将localhost加载到应用程序的第一页(即登录名),然后在使用Visual进行调试时在我开始登录数据库的第一个调用后,Studio出现了

An exception of type 'System.ServiceModel.ProtocolException' occurred in mscorlib.dll but was not handled in user code mscorlib.dll中发生类型'System.ServiceModel.ProtocolException'的异常,但未在用户代码中处理

Additional information: The remote server returned an unexpected response: (405) Method Not Allowed. 附加信息:远程服务器返回了意外的响应:(405)不允许的方法。 Then I get the same message again and then it sends me to the error page. 然后,我再次收到相同的消息,然后将我发送到错误页面。

I am an IIS newbie, but I have ensured IUSER has the correct authorization and I have checked all of the web.configs, as well as the applicationHost file. 我是IIS新手,但已确保IUSER拥有正确的授权,并且已经检查了所有web.configs和applicationHost文件。 This has to be a IIS problem is what I have come up but I would gladly be wrong if someone told me I was wrong and corrected. 这是我要提出的IIS问题,但是如果有人告诉我我错了并且已纠正,我很乐意出错。 Thanks for the help. 谢谢您的帮助。

Code Example 代码示例

The first call to db where the first error pops up 在第一个错误弹出的第一个对db的调用

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

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

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

This is after clicking login public static int GetUserId(IIdentity contextIdentity) { FormsIdentity identity = contextIdentity as FormsIdentity; 这是单击登录后的公共静态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]);
    }

Then this for (int i = 0; i < ContextKeys.Length; i++) { string ContextKey = ContextKeys[i]; 然后,这表示(int i = 0; i <ContextKeys.Length; i ++){字符串ContextKey = ContextKeys [i]; if (ContextKey == "appErr") { obj = (Exception)HttpContext.Current.Application["appErr"]; 如果(ContextKey ==“ appErr”){obj =(Exception)HttpContext.Current.Application [“ appErr”]; HttpContext.Current.Application.Remove("appErr"); HttpContext.Current.Application.Remove(“ appErr”); } if (ContextKey == "userId") { user = (int)HttpContext.Current.Application["userId"]; } if(ContextKey ==“ userId”){user =(int)HttpContext.Current.Application [“ userId”]; HttpContext.Current.Application.Remove("userId"); HttpContext.Current.Application.Remove(“ userId”); } } errors out Object reference not set to an instance of an object then goes to our customer error page 错误退出没有将对象引用设置为对象实例,然后转到我们的客户错误页面

I got it figured out. 我明白了。 I needed to install HTTPActivation in WCF. 我需要在WCF中安装HTTPActivation。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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