How does one implement AutoSetup when using a Decoupled CMS Site? #16249
Replies: 5 comments 19 replies
-
Try the following services .AddOrchardCms(builder => builder.AddSetupFeatures("OrchardCore.AutoSetup")) as it's shown in https://github.com/OrchardCoreContrib/OrchardCoreContrib.Modules/blob/main/src/OrchardCoreContrib.Modules.Web/Startup.cs Otherwise, I need to check because I saw a strange behavior in the last two weeks when I was using AutoSetup in another project |
Beta Was this translation helpful? Give feedback.
-
What you show should work, so I suspect something is incorrectly configured in the appsettings, or there's some error running it. What's in your appsettings? Do you see anything in the logs? |
Beta Was this translation helpful? Give feedback.
-
Here is the log from running the webapp using a copy of the "Blank" recipe (./Recipes/test.recipe.json):\
More Verbose log here: |
Beta Was this translation helpful? Give feedback.
-
Solved. I was mistakenly using the Recipe File Name prefix rather than the Name property listed in the recipe json. Apparently the recipe file name is immaterial, it is the "name" property in the recipe json file that is the key. The documentation on Auto_Setup here: https://docs.orchardcore.net/en/latest/reference/modules/AutoSetup/, could be made a little more clear on this. |
Beta Was this translation helpful? Give feedback.
-
In https://docs.orchardcore.net/en/latest/reference/modules/Recipes/...
In https://docs.orchardcore.net/en/latest/reference/modules/AutoSetup/...
|
Beta Was this translation helpful? Give feedback.
-
I created a decoupled CMS Site using the instructions here: https://docs.orchardcore.net/en/latest/guides/decoupled-cms/ - up to the point of creating any content.
I then followed the instructions here: https://docs.orchardcore.net/en/latest/reference/modules/AutoSetup/, (and related Setup instructions) to add the settings to Auto-Setup my Default Tenant.
My startup code looks like this...
builder.Services.AddOrchardCms().AddSetupFeatures("OrchardCore.AutoSetup");
...and the Auto-Setup values are in appsettings.json
On running the webapp, the Auto-Setup is never triggered. It always shows the Setup screen.
I suspect I probably need to enable one or more features in Program.cs but which ones? I have tried a few combinations but either the setup screen appears or I get exceptions before Setup screen is rendered.
Beta Was this translation helpful? Give feedback.
All reactions