In making NuGet modules for my company's internal re-use library I finally embarked on making a module with a visual component. The .cshtml file for this module will reside in a location specific to modules (not the standard "Views" folder) so I have been putting a secondary web.config in the same folder with the view to allow for MVC and Razor.
The problem becomes, although I can specify a version of MVC as a dependency in my .nuspec file, I don't want to have to be version specific being that all the functionality I am using in my views exists in all versions of MVC.
Is there a way I can get a view into a specific (and non-traditional) folder and have it operate using shared MVC binaries and configuration? Is it possible to do this in all types of projects without requiring any extra steps for a person to take after installing the NuGet package?
You have few options:
VirtualPathProvider
to get them ( example at http://www.ianmariano.com/2013/06/11/embedded-razor-views-in-mvc-4/)The problem with dependency into Asp.Net MVC is that it wasn't always backwards compatible, but this you will have to check yourself
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With