วันพุธที่ 22 เมษายน พ.ศ. 2558

ปัญหา MVC 5 ไม่สามารถ Log Off ออกได้ในบางครั้ง

สาเหตุน่าจะมาจากการเปลี่ยนชื่อ Cookie ของโปรแกรมเพื่อกัน ลอกอินข้ามแอพ แต่เป็นผลให้ ไม่สามรถ Log Off ออกได้ในบางครั้ง

แก้ได้ด้วยการ เปลี่ยน คำสั่ง ใน LogOff จาก

AuthenticationManager.SignOut();

เป็น

AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);

ลองดูแล้วก็ Work ดี จดไว้ก่อน

ref1 : http://stackoverflow.com/questions/29290120/cant-logoff-identity-mvc-5-sometimes
ref2 : http://stackoverflow.com/questions/28642284/asp-net-mvc-5-w-identity-2-2-0-log-off-not-working

วันพฤหัสบดีที่ 16 เมษายน พ.ศ. 2558

How to open MVC 2 or MVC 1 in Visual Studio 2013

Step 1: Right click on the project and click “Edit projectname.csproj”.
Step 2: In the opened file find the tag and from there delete the following GUID:
ASP.NET MVC 2: {F85E285D-A4E0-4152-9332-AB1D724D3325}
This actually works also for ASP.NET MVC 1 projects
ASP.NET MVC 1: {603c0e0b-db56-11dc-be95-000d561079b0}

Step 3: Save the file and reopen the solution in Visual Studio.


ref: http://dotnetdaily.net/tutorials/open-mvc-2-project-visual-studio-2012/