2015-05-19 85 views
0

我使用ASP.NET MVC默認帳戶系統,最近,當我嘗試登錄或註冊我得到這個錯誤:路徑中的非法字符。 AccountController.cs

Server Error in '/' Application.

Illegal characters in path.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Illegal characters in path.

Source Error:

Line 46: if (ModelState.IsValid) Line 47: { Line 48: var user = await UserManager.FindAsync(model.UserName, model.Password); Line 49: if (user != null) Line 50: {

Source File: c:\Users\u1152923\Desktop\newsWebApplication\newsWebApplication\Controllers\AccountController.cs Line: 48

沒有發生任何變化的AccountController.cs最近做,所以我不明白問題來自哪裏。

有可能對web.config進行更改可能導致錯誤。完整的web.config低於:

http://pastebin.com/iMviLJGS

任何幫助表示讚賞。

+0

請問您可以發佈您的**控制器**代碼嗎? –

+0

嗨@MokshShah在這裏你去http://pastebin.com/BiHTEpwp – Chrimes

+0

你檢查你的連接字符串在web.config?也許有什麼地方出錯了...... –

回答

0

我設法解決它!問題實際上來自IdentityModel.cs 請確保以下內容引用了正確的連接!

public class ApplicationDbContext : IdentityDbContext<ApplicationUser> 
{ 
    public ApplicationDbContext() 
     : base("DefaultConnection") 
    { 
    } 
} 

謝謝大家的幫忙。

相關問題