网站管理工具无法与 ASP.NET MVC 一起使用

发布于 2024-07-16 06:13:29 字数 659 浏览 5 评论 0原文

我刚刚开始使用 ASP.NET MVC,并且正在尝试使用这种新架构进行身份验证。

因此,我开始遵循官方网站中的教程,当我尝试通过网站管理工具添加一些用户时,我发现了此错误:

您选择的数据存储有问题。 这可能是由于 无效的服务器名称或凭据,或者权限不足。 这也可能是由于未启用角色管理器功能引起的。 单击下面的按钮将重定向到您可以选择的页面 一个新的数据存储。

以下消息可能有助于诊断问题:无法加载类型 'MyMvcApp.MvcApplication'。

现在,我在 web.config 中更改的唯一内容是连接字符串,并且我确信连接字符串不是问题(与我在其他项目中使用的相同)。

编辑:这是连接字符串:“Data Source=myMachine\SqlExpress;Initial Catalog=TestDB;User ID=TestUser;Password=123456”

我尝试了几种方法并用谷歌搜索很多,但没有任何效果。

那么,有什么想法吗? 正如我所说,除了连接字符串之外,我没有更改 web.config 中的任何内容。

提前致谢,

I'm just starting with ASP.NET MVC and I was trying the Authentication with this new architecture.

So, I started following a tutorial in the official site and, while I was trying to add some users through the Web Site Administration Tool, I found this error:

There is a problem with your selected data store. This can be caused by
an invalid server name or credentials, or by insufficient permission.
It can also be caused by the role manager feature not being enabled.
Click the button below to be redirected to a page where you can choose
a new data store.

The following message may help in diagnosing the problem: Could not load type
'MyMvcApp.MvcApplication'.

Now, the only thing I changed in the web.config was the connection string and, I'm sure the connection string is not the problem (is the same I'm using in other project).

EDIT: Here is the connection string: "Data Source=myMachine\SqlExpress;Initial Catalog=TestDB;User ID=TestUser;Password=123456"

I tried several things and googled a lot, but nothing worked.

So, any ideas? as I said, I did not change anything in the web.config besides the connection string.

Thanks in advance,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅气称霸 2024-07-23 06:13:29

发现问题:我只需要在启动 WSAT 之前编译解决方案。

感谢大家的回答。

Found the problem: I just need to COMPILE the solution BEFORE starting the WSAT.

Thanks to everyone for your answers.

空‖城人不在 2024-07-23 06:13:29

嗯,就像消息所说的那样,此功能需要启用真正的管理,而默认的 MVC 网站模板已禁用此功能。 进入 Web.config 并将: 更改

<roleManager enabled="false">

<roleManager enabled="true">

另一件需要检查的事情: 确保在创建 SQL 成员资格提供程序元数据时,您以在运行时有用的用户身份进行连接。 换句话说,如果您以 sa 身份连接,则元数据将位于 dbo 架构中。 但是,如果您以自己的身份连接,则元数据将位于您的架构中,这对其他应用程序不一定有用。 您应该运行 SQL Server Management Studio 来验证元数据放置在哪个架构中。

Well, like the message says, this feature requires real management enabled, and the default MVC web site template has this disabled. Go into Web.config and change:

<roleManager enabled="false">

to

<roleManager enabled="true">

One other thing to check: Make sure that when you create the SQL Membership Provider metadata you connect as a user who will be useful at runtime. In other words, if you connect as sa, then the metadata will be in the dbo schema. But if you connect as yourself, then the metadata will be in your schema, which isn't necessarily useful to other applications. You should run SQL Server Management Studio in order to verify in which schema the metadata is placed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文