I'm getting compilation errors because of missing references in the back-end project. As far as I can tell I have copied all relevant packages and files, but there are still errors.
Now I tried to apply the same thing for Umbraco 10, as best I could. But it was not a success.
Do you happen to know of a guide I can follow? I'm sure I missed something somewhere.
Unfortunately, I've been messing around with it so much already that I can now run the project but I'm getting the error: The migration plan does not support migrating from state "5d84fee1-388c-4e5f-b98c-1e66947278f1".
So I think I have to start over from scratch again :(
Does that guide seem applicable to Umbraco 10 to you? Aside from the fact that web.config is now a json file and the packages have a different name.
I managed to get it working on a new project.
I did have to add a reference from the web project to the core project DLL. I tried by just copying to the folder, but that gave me an error.
If your controllers are not in the Web project but in the Core, you might need to load the assembly part in the mvc builder with below code in your Startup Configure Services.
var mvcBuilder = services.AddControllers();
// This allows your Core to load controllers
mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(Assembly.Load("MyProject.Web.Core")));
Splitting core and web
Hi everyone.
In my Umbraco training for version 8, I learned that it's possible (and sometimes good) to split the VS project into a core project and a web project.
I've tried doing the same in Umbraco 10, but can't get it working. Is this still possible for Umbraco 10/11? And if so, how?
Hi Pieter,
Yes it is still possible, what is not working for you exactly?
Hi Huw
Thanks for your answer :)
I'm getting compilation errors because of missing references in the back-end project. As far as I can tell I have copied all relevant packages and files, but there are still errors.
I followed this guide for a previous project (Umbraco 8): https://www.codecraftsman.us/my-umbraco-v8-project-setup-in-visual-studio/
Now I tried to apply the same thing for Umbraco 10, as best I could. But it was not a success. Do you happen to know of a guide I can follow? I'm sure I missed something somewhere.
Hi Pieter,
What sort of missing references are you getting? Do they relate to your models or core umbraco stuff?
Huw
Unfortunately, I've been messing around with it so much already that I can now run the project but I'm getting the error: The migration plan does not support migrating from state "5d84fee1-388c-4e5f-b98c-1e66947278f1".
So I think I have to start over from scratch again :(
Does that guide seem applicable to Umbraco 10 to you? Aside from the fact that web.config is now a json file and the packages have a different name.
Yes, apart from the modelsbuilder stuff which now goes in appsettings.json
Alright. I will give it another try then. Thanks for your help so far :)
I managed to get it working on a new project. I did have to add a reference from the web project to the core project DLL. I tried by just copying to the folder, but that gave me an error.
After adding the reference it worked as intended.
Thanks again.
Hi,
If your controllers are not in the Web project but in the Core, you might need to load the assembly part in the mvc builder with below code in your Startup Configure Services.
I've never had to do that myself to access controllers from my core project
Hi Roy
I will give it a try and see if it helps. Thanks for the suggestion!
Hi Roy,
I don't think this is needed. I always have my controllers in a separate project and never needed this piece of code to get it working.
Dave
is working on a reply...