Couple of things to make sure -
Additionally, When I was trying to set it up on my local I realized the CLI commands were outdated. I had to figure it out with opening a forum discussion and based on responses I received; Finally got it configured. You can go through my blog post if it helps.
https://world.optimizely.com/blogs/stackmanoz/dates/2022/3/updated-commands-to-install-commerce14-and-cms12/
I believe those are still spot-on in terms of setting up latest version with optimizely CLI.
Do let me know if it helped.
Hi Manoj,
Thanks for the recommendations. Here's what I'm seeing.
"ConnectionStrings": {
"EPiServerDB": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\ExampleProject.mdf;Initial Catalog=ExampleProject;Integrated Security=True;Connect Timeout=30"
},
I can login to SSMS and see the db was created, but there are no tables.
My versions of optimizely db cli and episerver.templates
I used this command to create the alloy template
I was under the impression that with the new project templates, the database would be automatically created. It wasn't. So I figured I would try to update the schema and I know the old initialize-epidatabase command no longer works. So i tried dotnet episerver update-database ExampleProject.csproj. I'm getting a SqlException(0x80131904): Cannot attach the file ' C:\users\.dotnet\tools\.store\episerver.net.cli\2.0.0\episerver.net.cli\2.0.0\tools\net6.0\any\ExampleProject.mdf as database 'ExampleProject'
Does that path look fishy? Shouldn't it be trying to attach the mdf file from the App_Data folder as database 'ExampleProject'? There is no mdf file in that location. Why is it looking there?
I am not sure if you need to run dotnet episerver update-database anymore.
This thread which might help you in setting up -
Addtionally, You can try following steps in my blog if that helps you -
If nothing works at all, We can connect and look at it together.
Can someone explain in detail why this error happens. I get it occasionally on brand new CMS 12 projects created via CLI or VS22. I see the mdf file in the App_Data folder. Somewhere it's failing to create the db however. I don't see the db in MSSQLLocalDb.