This repository was archived by the owner on Dec 14, 2018. It is now read-only.
ViewModel's aren't found when they are in an external assembly alongside an embedded View. #4100
Labels
Milestone
Simple repro here: https://github.com/dazinator/mvc6-view-components/commits/issue-noprojectreferences - just run the project and browse to url
/Books
The issue is that when you place your Razor View in an external assembly, and you also create a Model class in that assembly, and in your main application you create an embedded file provider to allow the view to be resolved, MVC is still not able to resolve it's Model despite the fact its in the same assembly as the view. There doesn't seem to be any obvious API that can be called to tell MVC that the Model is in the same assembly as the embedded view. Creatiing an
IAssemblyProvider
that returns the assembly containing the model in the list of candidate assemblies also does not fix the problem. How does MVC 6 resolve the list of assemblies to compile the Razor View against and how to we get it to include the assembly with the model?Any ideas?
The text was updated successfully, but these errors were encountered: