문제

왜 기본"일반적인 핸들러는"코드 ASP.NET 3.5 웹 응용 프로그램 추가 특성을 클래스를하지만 올바른 네임스페이스 참조가 있습니다.이것은 템플릿 그들은 당신 out-of-the-box:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Handler1
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class People : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

왜 그들이는 라인에서 최고:

using System.Web.Services;

이것이 버그에서 기본 템플릿?나는 뭔가?

도움이 되었습니까?

해결책

편집:지금 내가 그것을 추가할 때 일반적인 핸들러 웹사 응용 프로그램 (도하에서 당신의 질문에 첫 번째 시간)을 얻을 새로운 작동하지 않는 템플릿입니다.동의함으로 다른 사용자가는 당신은 단지 편집 기본 템플릿입니다.를 사용하는 경우 MVC,당신은 당신이 필요하지 않 처리기 더 이상 그러나입니다.

처럼 보이는 그것이 알려진 버그 여기 MS 연결 문제에 대한 이.

를 편집하려는 경우 템플릿,그것은 여기에 있:C:\Program Files\Microsoft Visual Studio9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033\Handler.zip

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top