我正在尝试将一个基本的web应用程序从Windows 7上的visual studio上载到Windows Server 2007上的IIS环境。
虽然从IIS启动它会显示登录页面,但尝试导航到主菜单时会返回以下错误:
Server Error in Application "PARKING/PARKING ASSIGNMENTS WEB"Internet Information Services 7.0
Error Summary
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Detailed Error Information
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://localhost:81/Parking Assignments Web/Home
Physical Path C:\ParkingAssignmentsWeb\Home
Logon Method Anonymous
Logon User Anonymous
Most likely causes:
•The directory or file specified does not exist on the Web server.
•The URL contains a typographical error.
•A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
•Create the content on the Web server.
•Review the browser URL.
•Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
Links and More InformationThis error means that the file or directory does not exist on the server. Create the file or directory and try the request again.
View more information »这是我用来导航的代码:
Response.Redirect("Home.aspx");为什么此导航在Visual Studio上有效,而在IIS上无效?
更新:我尝试了你们展示给我的重定向命令的变体,但它们都给出了404错误,这让我相信问题不是命令的问题,而是其他的问题。知道是什么吗?
发布于 2017-03-23 03:15:51
请尝试:
Response.Redirect("~/Parking Assignments Web/Home.aspx");或
Response.Redirect("~/Parking Assignments Web/Home");发布于 2017-03-23 03:20:13
它将Home.aspx视为相对路径。
像这样使用它:
Response.Redirect("/Home.aspx");发布于 2017-03-23 03:21:37
当您部署到IIS时,将使用不同的web服务器。Visual studio使用具有有限选项的web服务器,并且在大多数情况下(但不是所有情况下),当应用程序部署到windows服务器上的IIS时,应用程序应该在不做任何更改的情况下运行。
要检查的事项
”)或("/ folder /home.aspx"),其中server
的实际文件夹名
https://stackoverflow.com/questions/42960552
复制相似问题