Closed gabrielacosta closed 6 months ago
This is a bad idea to reference Orchard Core inside a module. It should be referenced only on your main website project like OrchardCore.Cms.Web for example in our templates.
If you need to reference a specific OrchardCore module in your project you can reference these instead.
If I look at your solution folders and project I'd say that OrchardCore.Cms.Web would be equivalent to your Main.csproj. This is the only place where you should reference OrchardCore.Application.Cms.Target.
Please explain what you are trying to achieve so that we can understand better and help you. Else the solution is to revert the changes that makes this fail to run.
Hi Skrypt, Thanks for replying. What I'm trying to achieve is having one website as landing using the Orchard CMS. Then I want to add to it more modules that will do other functionalities, but still use security model from the CMS. So, if have two specific roles such as admin and customer, those modules can have dashboards or other CRUD type of code not related with the content of the landing website.
Create 2 different tenants then.
Landing Website = host tenant Child Website = activate module 1 Child Website 2 = activate module 2 ...
Then these 2 websites/tenants are not going to use the same Content Types than the host one. And your modules can register a custom route for your "/dashboard" which will be secured by it's controller like we do in OrchardCore.Contents module AdminController. But instead of naming it AdminController you name it DashboardController.
And this way each tenants can have their own custom dashboard. But you should not activate both modules in the same tenant if they both register a /dashboard route.
Hi Skrypt,
I just tried.
And I got another error.
I checked other possible issues, but I'm quite sure I do not use AddMvc() in the startup of the landing.
Do you know, what could be the issue.
Kind regards, G
Look at the templates for examples :
Your CMSLanding here will be probably needing the startup.cs and program.cs from this template module :
I already the startup and the program as recommended from the templates.
However, the error still appearing...
I think another ticket was setup before https://github.com/OrchardCMS/OrchardCore/issues/3453
But, I do not use Sqlite, the landing CMS is using the blank template and SQL Server 2012.
I upload the solution to
Your module / startup definitions don't seem correct.
Suggest:
Create one Web project which calls .UseOrchardCore()
Create as many modules as you want after that.
Do your code in those modules.
Don't call .UseOrchardCore()
again.
Hi Dean,
Thanks for the suggestion. I already try that and I know it works. However, I want to use the cms component. I don't get how your suggestion helps me to achieve that.
Hi Dean,
Thanks for the suggestion. I already try that and I know it works. However, I want to use the cms component. I don't get how your suggestion helps me to achieve that.
@gabrielacosta,
The issue is you have not created the tenant, but your appsettings.json has configuration for it with the states set to running
. but if you inspect the tenants.json
in your App_Data folder, there is only the default
tenant. Note; this is only an issue if you're using OrchardCMS
create a new occms
first install the templates:
dotnet new -i OrchardCore.ProjectTemplates::1.0.0-*
then navigate to a folder:
dotnet new occms -n MySite
launch the site, select blog
or saas
navigate to features and activate tenants
feature:
do the setup:
click setup:
navigate to the prefix you set:
your App_Data folder should now have a new entry in tenants.json
.
See https://github.com/OrchardCMS/OrchardCore/pull/5422 for how to preconfigure it:
So now, for the documentation
To provide preconfig values for a given tenant you need a tenant valid state as Uninitialized. This will automatically create a tenant at runtime using these values.
To only provide config values for a given tenant don't specify a tenant state. These values will be only used when the tenant is manually created.
here's a screenshot;
Hope that helps!
Here's the repo; https://github.com/weirdyang/orchardcore-demo
Hi,
I'm trying to use Orchard and have:
I create a solution with a working example of what I'm trying to achieve. https://github.com/gabrielacosta/WebApplication1
First, I created everything and it works fine. I added to the landing only the OrchardCore.Module.Targets Nuget.
Landing
Admin
Customer
Until that point, everything works fine.
However, when I tried to add the CMS Nuget to the Landing Module.
And modify the startup on the landing to load OrchardCMS
The solution compiles without any issues.
However, when I run it I got this error.
I'm not sure how to fix it. Or if the model that I'm trying to build is correct.
Could you please review the solution and let me know.
Kind regards,
G