Visual Studio 2010과 C# 4.0에서 MVC 3을 사용하고 있습니다. Visual Studio에서 IIS 프로덕션 환경에서 원격으로 프로덕션 IIS 7.5 서버에 배포 할 때 내 응용 프로그램이 올바르게 작동합니다.IIS 7과의 라우팅 오류 대 HTTP 404 오류가 발생하는
내 개발 시스템에서 전체 IIS 7.5 서버를 사용하도록 전환하면 갑자기 두 컨트롤러에서 동작에 대한 HTTP 404 오류가 발생하기 시작했습니다. 다른 컨트롤러는 올바르게 작동합니다. Visual Studio에서 응용 프로그램을 실행하거나 IIS에서 직접 실행합니다.
구성 차이가 없습니다. 이 동작을 전시하는 컨트롤러의
하나는 : IIS Express에서 예상과는 IIS에 배포 된이 동작
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Configuration;
using Mbrrace.ApplicationServices.Validation;
namespace Mbrrace.WebUI.Areas.Validation.Controllers
{
public class ValidationController : Controller
{
//
// GET: /Validation/Validation/
[HttpGet]
public JsonResult PostcodeCheck([Bind(Prefix = "perinatalView")]AddressViewModel model)
{
// postcode has already been checked for correct format
// now look it up to see if it exists
if (PostcodeChecks.CheckPostcodeExists(ConfigurationManager.ConnectionStrings["CommonCodeEntities"].ConnectionString, model.Postcode))
{
return Json(true, JsonRequestBehavior.AllowGet);
}
return Json("This postcode was not found in the database", JsonRequestBehavior.AllowGet);
}
[HttpPost]
public JsonResult PostcodeExtendedCheck(String Postcode)
{
// check if it exists or of it's sector exists (all but last two characters
string message = PostcodeChecks.PostcodeExtendedCheck(ConfigurationManager.ConnectionStrings["MbrraceCommonCodeEntities"].ConnectionString,
Postcode, Postcode.Substring(0, Postcode.Length - 2));
string success = (message.Length == 0) ? "OK" : "NO";
var result = new { Success = success, Message = message };
return Json(result, JsonRequestBehavior.AllowGet);
}
public class AddressViewModel
{
public string Postcode { get; set; }
}
}
}
. IIS가 디버깅을 위해 프로젝트에 연결되면 404 오류가 발생합니다.
404 오류가 생성되는 이유에 대해 알려주시겠습니까?
관리 파이프 라인 모드를 응용 프로그램 풀에 통합하도록 설정 했습니까? – levelnis
감사합니다. 예, 우리는 "32 비트 앱 허용"을 확인했습니다. –
해당 컨트롤러의 경로를 표시 할 수 있습니까? 액션에 어떤 속성이 있습니까? 모든 사용자 정의 처리기가 실행 중입니까? – levelnis