Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
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

@dazinator

Description

@dazinator

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?

image

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions