I'm trying to create a custom dashboard where all the assets and code will sit in the dedicated project (class library).
I've created all the views, scripts and styles as well as manifest file and everything works well when I keep above files in the App_Plugins directory within main CMS project.
When I move the assets for my dashboard to the App_Plugins in my external project, my custom view disappears with no error. What is funny, the assets are correctly copied to the bin directory.
I've tried with implementing manifest via C# code but even when I'm able to at least see the dashboard tab, I'm receiving an error that the view is missing:
What am I doing wrong?
I think the missing step is that the AppPlugins folder needs to be copied to the AppPlugins folder of your CMS project. It needs those files to be in the CMS project.
If you start a new Umbraco package project using the Umbraco template for a package, you'll see that you need a targets file that takes care of this. This file makes sure that AppPlugins folder of your package is copied to the AppPlugins folder of you CMS when you build the CMS project that uses the package.
So you should have a folder in your package project called buildTransitive which should have a file called -projectname-.targets.
Custom dashboard from external project
Hi,
I'm trying to create a custom dashboard where all the assets and code will sit in the dedicated project (class library).
I've created all the views, scripts and styles as well as manifest file and everything works well when I keep above files in the
App_Plugins
directory within main CMS project.When I move the assets for my dashboard to the
App_Plugins
in my external project, my custom view disappears with no error. What is funny, the assets are correctly copied to the bin directory.I've tried with implementing manifest via C# code but even when I'm able to at least see the dashboard tab, I'm receiving an error that the view is missing: What am I doing wrong?
Hi Mateusz.
You cannot use a class library for the containment of the /App_Plugins/ files.
You need to create a Razor Class Library which is intended for this purpose.
Markus wrote something about it here: https://www.enkelmedia.se/blogg/2023/5/9/converting-a-umbraco-package-to-a-razor-class-library
Hi Bo,
thank you for the clue! I'll try it out!
Btw.
Kevin Jump also wrote a very good guide in steps here: https://dev.to/kevinjump/umbraco-10-razor-class-library-packages-pt1-3nfa
Hope it gets you on the right track.
I think the missing step is that the AppPlugins folder needs to be copied to the AppPlugins folder of your CMS project. It needs those files to be in the CMS project.
If you start a new Umbraco package project using the Umbraco template for a package, you'll see that you need a targets file that takes care of this. This file makes sure that AppPlugins folder of your package is copied to the AppPlugins folder of you CMS when you build the CMS project that uses the package.
So you should have a folder in your package project called buildTransitive which should have a file called -projectname-.targets.
This file is responsible for copying the AppPlugins folder of your package to the AppPlugins folder of your CMS on build.
is working on a reply...