This post may help:
Thanks for your response.
I have looked into the Geta plugin, and while it seems to be a great plugin I would really prefer to utilize the official support for Razor views in my particular case. The release notes does indicate that it is now supported, and the author of the Geta plugin goes a long way in recommending its users to move on to the officially supported approach.
Hi, I just wrote about how to create a plugin using razor views: https://swapcode.wordpress.com/2018/03/16/how-to-create-episerver-admin-plugin-using-razor-view-engine-and-mvc/
The difference in my implementation is that there is no custom initilization modules needed and no custom routes. Maybe my posting helps you if you still have this issue.
Thanks for sharing your blog!
I'm in the process of developing an Episerver addon. My addon is strucuted like an MVC application and is heavily inspired by the skeleton project at https://github.com/mariajemaria/AddOn.Initial. I am using Razor views as they are supposedly supported since version 10.10.0 (I'm specifically at 11.1.0). However, I can't seem to get the addon to resolve my razor views properly. I'm getting the infamous exception:
This is my controller:
My view is located at ~/Views/MyModule/Index.cshtml and looks like this:
Moreover, my module is setup as a Nuget package and this is a snippet of my .nuspec file:
When you install the nuget package to an Episerver project, the zip file is correctly placed in ~/modules/_protected/MyEpiserverModule/MyEpiserverModule.zip and the web.config.install.xdt makes sure the
section of the project's Web.config looks like this:
The zip file seems to contain all necessary files in the correct structure.
Can anyone see what I am missing that's preventing my views from resolving properly? My project can be downloaded at https://www.dropbox.com/s/5bhemb3k0rttbtr/MyEpiserverModule.zip?dl=0. There is a Nuget package located at the project's root. This can be installed to an Alloy project to test the module. It shows up correctly in the "Tools" section of the Episerver admin interface. But when I click on the link to open it, the exception is thrown complaining about the missing view.
Any feedback is greatly appreciated. Thanks for your time.