November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
You should not use path to your view as "location" of the module. View is just a template that will be used by Razor ViewEngine to render the result. "Somebody" has to execute request - that's Mvc Controller. Instead - try to point to your controller:
[..., UrlFromModuleFolder = "MyPlugin", ...]
I never tried making modules before. I tried changing the UrlFromModuleFolder as you showed but the same error message still appears but with a slightly changed path.
I have not specified any module location and only the assembly name in config files, and I do not find any location config settings in the projects I have been looking in for help either. I do not understand what you are saying I should change.
There are probably some more things I need to configure aswell. Currently to be able to run and debug my code at all I have added the bin file of the project's assembly as a dependency to the AlloyMvc project... (Its working, a Scheduled job that is a part of the module runs without any problems on Alloy)
I have uploaded my code to GitHub if anyone wants to take a look and come with suggestions on what may be wrong.
I have been trying some more things including the changes in valdis pull request.
After much struggle I have found a solution that requires me to build a nuget package and reinstall it everytime I want to test even the smallest changes in my dev environment. However, it is working!
The biggest change was that I had to start building the project to a nuget and install it for the views to work, I had hoped to avoid the nuget step in my dev environment. Other things that I tried may also have been required, the code on GitHub is updated.
Here is my nuspec file and I build the package from inside the nuget-directory with the following command that gives me a package I can install in my test project:
nuget.exe pack ..\MoreCmsReports.csproj.nuspec
The routes section in module.config is not required, the UrlFromModuleFolder needs to match the controller name (excluding controller suffix).
Hello!
I am working on a hobby project that will add an admin plugin and a couple of cms reports. I plan to package it as a nuget package for others to use. Currently I am stuck on how to set the url for the view files (Razor) and where to place them in the project.
I have been looking at a couple projects on GitHub and I currently have this (simplified) file structure:
My controller looks like this:
To test my code I have set up the AlloyMvc site as a second project in the solution and set Alloy to depend on my project. My plugin is detected and shows up in the admin interface but the view is not found. (error message reports searched physical path as {pathToSolution}\{theAlloyMvcProjectName}\EPiServer\CMS\Admin\MyPlugin\Index)
The EPiServer documentation on custom reports specifies a url in a hardcoded way and adds a route in the global.asax file but that is not an option.
I hope for a solution that makes it easy to test while coding and that also will work when package as a nuget and installed by someone else. What do I need to configure and where?