1

We are working on ASP.NET MVC 6 project and it's necessary to load and then compile Razor views from an external source (Azure document database).

I see in other SO posts (<= MVC 5) it was possible to create and register a custom VirtualPathProvider which can take view content from DB or resource DLLs (for example).

What are the options for MVC 6 ?

2
  • 1
    have you tried way provided for posts (>= MVC 5) in MVC 6? Commented Dec 15, 2015 at 5:54
  • Thanks, VirtualPathProvider looks to not be available in mvc6 Commented Dec 15, 2015 at 9:59

2 Answers 2

2

Technically not implemented yet. This is after all a rewrite and not just a set of new features.

I found a thread on GitHub which talk about a way to get what you need.

Basically, it's about providing your own implementation of IFileProvider.

I have virtually no experience in implementing this but I think that if you have time to spare, this is definitely the way to go.

Sign up to request clarification or add additional context in comments.

Comments

0

A bit late to the party, but if you are still looking at this I have just posted a sample project to GitHub showing how to store your .cshtml in Azure Blob storage using ASP.NET 5 / MVC 6.

@Maxime Rouiller - MVP is correct that you need to provide a custom IFileProvider. My sample is using rc1-final and working. Looking at the aspnet project though, this may change subtly later (will allow multiple providers to be registered)

A blog post write up on this should be coming in the next few days too.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.