2016-07-27 5 views
1

Visual Studio 2015를 사용하여 간단한 ASP.NET 핵심 응용 프로그램을 개발하고 로컬 컴퓨터에서 테스트했습니다. 모든 것은 기대에 따라 달리고있었습니다.게시 후 웹 응용 프로그램이 응답하지 않습니다.

FTP를 통해 내 웹 호스팅 서버에 업로드 한 후 갑자기 실제 페이지가 표시되지 않습니다.

내 말은 라우팅이 올바르게 작동하고 있다는 것을 알 수 있다는 것입니다 (원래 주소가 /App/Index이지만 내가 알 수없는 이유로 응용 프로그램에 로그인하지 않았기 때문에 즉각 012B으로 이동했습니다. (I 페이지를 검사 아무것도) 빈 페이지를 참조하십시오

그냥 언급 -. 때문에 내 웹 서버의 폴더 구조가 어떻게 관리되는지 &을 어떻게 작동하는 방식에, 나는 wwwroot에의 모든 인스턴스의 이름을 변경했다 www_root으로 변경되었지만 이미 완료되었습니다 ... 이전 응용 프로그램과 정상적으로 작동하고 있습니다.

여기서 무엇이 잘못 될 수 있습니까? 내 견해가 앱에 제대로 주입되지 않은 이유는 무엇입니까?

EDIT 1 - 추가 정보 여기에

은 내위한 인증 방법은 다음과 같습니다

설정

 services.AddIdentity<IP_User, IdentityRole>(config => 
     { 
      config.User.RequireUniqueEmail = true; 
      config.Password.RequiredLength = 5; 
      config.Cookies.ApplicationCookie.LoginPath = "/Auth/Login"; 
      config.Cookies.ApplicationCookie.Events = new CookieAuthenticationEvents() 
      { 
       OnRedirectToLogin = ctx => 
       { 
        if ((ctx.Request.Path.StartsWithSegments("/api")) 
        && ctx.Response.StatusCode == (int)HttpStatusCode.OK) 
        { 
         ctx.Response.StatusCode = (int)HttpStatusCode.Unauthorized; 
        } 
        else 
        { 
         ctx.Response.Redirect(ctx.RedirectUri); 
        } 

        return Task.FromResult(0); 
       } 
      }; 

     }).AddEntityFrameworkStores<ShoppingContext>(); 

Startup.cs에서와 AuthController 미만 :

public class AuthController : Controller 
    { 
     private SignInManager<IP_User> _signInManager; 

     public AuthController(SignInManager<IP_User> signInManager) 
     { 
      _signInManager = signInManager; 
     } 

     // GET: /<controller>/ 
     public IActionResult Login() 
     { 
      if (User.Identity.IsAuthenticated) 
      { 
       return RedirectToAction("Index", "App"); 
      } 

      return View(); 
     } 

     [HttpPost] 
     [ValidateAntiForgeryToken] 
     public async Task<IActionResult> Login(LoginViewModel vm, string ReturnUrl) 
     { 
      if (ModelState.IsValid) 
      { 
       var result = await _signInManager.PasswordSignInAsync(vm.Username, vm.Password, true, false); 

       if (result.Succeeded) 
        return RedirectToAction("Index", "App"); 
       else 
        ModelState.AddModelError("", "Username or Password incorrect."); 
      } 

      return View(); 
     } 

     public async Task<IActionResult> Logout() 
     { 
      if (User.Identity.IsAuthenticated) 
      { 
       await _signInManager.SignOutAsync(); 
      } 

      return RedirectToAction("Login", "Auth"); 
     } 
    } 

어디 IP_User 그냥 상속 된 IdentityUser

+0

로컬 IIS 인스턴스에서 VS를 호스팅하지 않으셨습니까? –

+0

아니, 지난 시간에 작동하지 못하게 설정하는 방법을 찾지 못했습니다. –

+0

원격 웹 호스트를 사용하기 전에 먼저 로컬로 배포하는 방법을 찾는다면 문제를 해결하기가 더 쉬울 것 같아요. . 마지막으로 로컬로 설정하려고 시도했을 때 - 정확히 동일하게 작동 했습니까? –

답변

1

결국 나는 게시 프로필을 제거하고 완전히 전체 웹 사이트를 다시 게시하여 이전 게시 폴더를 삭제하여 문제를 해결할 수 있습니다.

+0

RC1에서 RTM으로 마이그레이션 한 것 같습니다 (읽음 : DNX에서 dotnet-cli로)? – Tseng

관련 문제