データベースにAP.Netのメンバーシップを追加しようとしています。私は過去にこれで成功していたので、私が何をやっているのかがわかっています。私のプロジェクトはFramework 4.5.2のVB.Netウェブサイトです。私はフレームワーク4でasp_regsql.exeを使用して、私のdbにスキーマを追加しました。私は(MSDNの記事あたり)以下のweb.configエントリを作成:ASP.NetメンバーシップエラーCREATE DATABASEが失敗しました。リストされたファイル名の一部を作成できませんでした。関連するエラーを確認してください
<connectionStrings>
<add name="AFKMSConnectionString" providerName="System.Data.SqlClient" connectionString="working as intended" />
<system.web>
<authentication mode="Forms" >
<forms loginUrl="Account/Login.aspx"
name=".ASPXFORMSAUTH" />
</authentication>
<!--<authorization>
<deny users="?" />
</authorization>-->
<compilation debug="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2"/>
<pages>
<namespaces>
<add namespace="System.Web.Optimization"/>
<add namespace="Microsoft.AspNet.Identity"/>
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
</controls>
</pages>
<membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add
name="SqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="AFKMSConnectionString"
applicationName="AFKMS"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
<profile enabled ="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="AFKMSConnectionString"
applicationName="AFKMS"
description="SqlProfileProvider for SampleApplication" />
</providers>
</profile>
<roleManager enabled ="true"
defaultProvider ="SqlRoleProvider" >
<providers>
<clear/>
<add name ="SqlRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="AFKMSConnectionString"
applicationName="AFKMS"/>
</providers>
</roleManager>
私の接続文字列は、私の現在の機能のために動作しますが、私は、私は次のエラーを取得するユーザーを登録しようとすると:
Directory lookup for the file "C:\Users\Dan\Source\Repos\AFKMS\AFKMS\App_Data\aspnet-AFKMS-140073d4-6858-4f19-9555-0edfbaadd43a.mdf" failed with the operating system error 2(The system cannot find the file specified.). CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
これはアカウント/登録、
薄暗い結果= manager.Cから来ていますreate(user、Password.Text)
なぜデータベースを作成しようとしていますか?私は行方不明のように見えますか?
'web.config'に接続文字列がありません。メンバシップおよびロールプロバイダ構成セクションは接続文字列を参照しますが、存在しません。 @ ahmedの答えは正しいです。 –
私は引用用の接続文字列を使いませんでした。それは私が現在持っている他のすべてのアプリケーション機能のために働く。 –
私は、ASP.Net 4.5.2アプリケーションのデフォルトは、おそらくIdentity Framework 2.0であり、旧メンバシップフレームワークではないと考えています。そのため、接続文字列を使用していない理由があります。 –