[英]IIS 8.5 Win 8.1 pro localHost not working
我研究了幾天,卻沒有找到答案。 我曾經用過Google以及Stack和MDSN,所以我終於認為是時候問這個問題了。 我是一名新開發人員,我完成了第一份作業,並且計算機壞了。 我有Win 8.1 Pro和IIS 8.5,現在我的任務是使它與SQL 2012一起使用。我擁有它,因此可以將localhost加載到應用程序的第一頁(即登錄名),然后在使用Visual進行調試時在我開始登錄數據庫的第一個調用后,Studio出現了
mscorlib.dll中發生類型'System.ServiceModel.ProtocolException'的異常,但未在用戶代碼中處理
附加信息:遠程服務器返回了意外的響應:(405)不允許的方法。 然后,我再次收到相同的消息,然后將我發送到錯誤頁面。
我是IIS新手,但已確保IUSER擁有正確的授權,並且已經檢查了所有web.configs和applicationHost文件。 這是我要提出的IIS問題,但是如果有人告訴我我錯了並且已糾正,我很樂意出錯。 謝謝您的幫助。
代碼示例
在第一個錯誤彈出的第一個對db的調用
MYapp.GlobalDataService.GlobalDataServiceClient gdc =新的Myapp.Proxy.GlobalDataService.GlobalDataServiceClient();
ReadLogosResult結果= gdc.GetLogos(_customerId,region_id,branch_id);
if (result != null)
{
logoContent = result.Logo;
}
這是單擊登錄后的公共靜態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]);
}
然后,這表示(int i = 0; i <ContextKeys.Length; i ++){字符串ContextKey = ContextKeys [i]; 如果(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”); 錯誤退出沒有將對象引用設置為對象實例,然后轉到我們的客戶錯誤頁面
我明白了。 我需要在WCF中安裝HTTPActivation。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.