gpt4 book ai didi

c# - 尝试在新创建的网站上注册时出现 asp.net mvc 5 错误

转载 作者:行者123 更新时间:2023-11-30 14:52:04 24 4
gpt4 key购买 nike

全新的操作系统,全新的 vs 2015,我所做的就是创建具有个人身份验证的新 mvc 项目,一旦我尝试注册它就会给我那个错误(我什么都不编辑,我什么也不删除)

Server Error in '/' Application.

The system cannot find the file specified

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.ComponentModel.Win32Exception: The system cannot find the file specified

Source Error:

Line 153: { Line 154: var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; Line 155: var result = await UserManager.CreateAsync(user, model.Password); Line 156: if (result.Succeeded) Line 157: {

Source File: c:\users****\documents\visual studio 2015\Projects\WebApplication5\WebApplication5\Controllers\AccountController.cs Line: 155

Stack Trace:

[Win32Exception (0x80004005): The system cannot find the file specified]

最佳答案

我遇到了同样的问题,我已经找到了解决方案.. ConnectionString 中存在问题,将其更改为:

connectionString="Data Source(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-WebApplication3-20160303101342.mdf;Initial Catalog=aspnet-WebApplication3-20160303101342;Integrated Security=True"

收件人:

  connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=YourDatabaseName;Data Source=YourServerName"

它会在没有任何其他更改的情况下工作

关于c# - 尝试在新创建的网站上注册时出现 asp.net mvc 5 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32582208/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com