第一個問題:在安裝Microsoft Visual Studio .NET2003時,沒有安裝IIS,而是後安裝的IIS,這種情況下,創建web應用時會報錯
解決方法:在命令提示窗口中運行如下命令即可:
%windir%/Microsoft.NET/Framework/v1.1.4322/aspnet_regiis.exe -i
第二個問題:關於IIS的配置,在安裝完IIS後最好做如下配置,否則在運行Web應用時可能會報一些權限方面的錯誤
解決方法:
第一步:打開IIS,右鍵單擊 Default Web Site -----〉Properties
第二步:在彈出的窗口中,單擊 Directory Security -----> Edit...
第三步:在彈出的窗口中,選中最下方的 Integrated Windows authentication複選框
第四步:一路點擊OK即可
第三個問題:在Web Application中使用Web Service代理類時出現的問題,運行時報如下所示的頁面錯誤
The request failed with HTTP status 401: Access Denied.
例如:WebForm1.aspx.cs中有如下代碼:
private void Page_Load(object sender, System.EventArgs e)
{
webService.Service1 ss=new WebApplication1.webService.Service1();
Response.Write(ss.HelloWorld());
}
其中,webService.Service1是一個Web Service代理類
解決方法:增加一行代碼(如下所示的紅色代碼)即可
private void Page_Load(object sender, System.EventArgs e)
{
webService.Service1 ss=new WebApplication1.webService.Service1();
ss.Credentials=System.Net.CredentialCache.DefaultCredentials;
Response.Write(ss.HelloWorld());
}
初學ASP.NET開發web應用時遇到的一些常見問題和解決方法
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
HOW TO:在圖形用戶介面中查看和轉移 FSMO 角色
lingping
2019-02-23 14:05:54
實現與 Outlook Web Access 的更改密碼功能
lingping
2019-02-23 14:05:54
如何將 .nk2 文件導入至 Outlook 2010
lingping
2019-02-23 14:05:54
誰說菜鳥不會數據分析(工具篇)出來啦
daoran123457
2019-02-23 13:48:41
Windows 2000 Active Directory FSMO 角色
lingping
2019-02-23 14:05:54
Windows 7 x64 with boot camp 4.0 - "unsupported model
lingping
2019-02-23 14:05:54
windows 2008 全新仲裁模式
qyh282110204
2019-02-23 14:05:36
調整Windows 7的DPI, 使文字閱讀更舒服【開始的搜索】
wwtwwttc
2019-02-23 14:05:24
系統慢、電腦性能變差自動診斷和修復
wwtwwttc
2019-02-23 14:05:23
Windows 7桌面背景幻燈片怎麼不動了
wwtwwttc
2019-02-23 14:05:21
iscsi存儲
samplelife
2019-02-23 13:57:35
Windows組策略屏蔽U盤有妙法(圖)
czq2008sky
2019-02-23 13:43:30
Windows PowerShell 批量遷移Windows用戶信息
781732825
2019-02-23 13:43:05
SQL 2008 R2安裝部署及端口開放
vip2008
2019-02-23 13:42:18
Windows server 2003 *** 配置實例
czq2008sky
2019-02-23 13:38:34