perkes456
perkes456

Reputation: 1181

Unable to setup episerver default application (failed to attach the episerver database)

I'm trying to integrate Episerver into my visual studio project. I've downloaded the Episerver CMS extension through NuGet manager and everything went well.. The issue here is that when I try to access the episerver CMS panel like this:

localhost:port/episerver/cms I get the following error

Directory lookup for the file EPiServerDB_ae17da15.mdf failed with the operating system error 5(Access is denied.).Cannot attach the file EPiServerDB_ae17da15.mdf as database 'EPiServerDB_ae17da15'.

And this is my connection string:

  <connectionStrings>
    <add name="EPiServerDB" connectionString="Data Source=.;AttachDbFilename=|DataDirectory|EPiServerDB_ae17da15.mdf;Initial Catalog=EPiServerDB_ae17da15;Connection Timeout=60;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
  </connectionStrings>

What am I doing wrong here? Can someone help me out?

Upvotes: 0

Views: 793

Answers (2)

Eric Herlitz
Eric Herlitz

Reputation: 26267

Try

  <connectionStrings>
    <add name="EPiServerDB" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|EPiServerDB_ae17da15.mdf;" providerName="System.Data.SqlClient" />
  </connectionStrings>

Using the MDF-database do require you to have SQL Server LocalDB installed, I believe it is available as an install option of Visual Studio as well.

== Edit ==

If you are missing the MDF-file simply create a new using Visual Studio, create a new item and select the SQL Server Database

enter image description here

Upvotes: 2

Andreas
Andreas

Reputation: 2366

As Erik mentioned you will need to have SQL Server LocalDB installed to attach the .mdf file if you go with that option. If you already have the "full" SQL-server installed you can create an empty database, add the relevant connectionString and run

Initialize-EPiDatabase

in the package manager console. Now you don't need to install LocalDB.

Upvotes: 1

Related Questions