0

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. 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

An exception of type 'System.ServiceModel.ProtocolException' occurred in mscorlib.dll but was not handled in user code

Additional information: The remote server returned an unexpected response: (405) Method Not Allowed. 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. 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. Thanks for the help.

Code Example

The first call to db where the first error pops up

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

ReadLogosResult result = 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;

        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]; 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("userId"); } } errors out Object reference not set to an instance of an object then goes to our customer error page

4

1 回答 1

0

I got it figured out. I needed to install HTTPActivation in WCF.

于 2015-01-15T18:04:41.627 回答