Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

ASP.NET CORE MVC Compiler Exception - View Models and HtmlHelpers in separate project #1319

Closed
joetherod opened this issue Jan 27, 2018 · 2 comments

Comments

@joetherod
Copy link

Running latest version of VS 2017, have Docker for Windows installed on Windows 10 with host set to linux
Running application via VS in debug all works fine, when running in Release mode I get compiler exceptions of the views, cant find namespace or reference. My razors views are retried from database and are compiled at runtime. Why is this issue happening in Release mode and not in Debug. Tried adding references in RazorViewOptions and still not working. Looked at this post and didnt see a resolution.

aspnet/Razor#715 (comment)

Please help.

@joetherod
Copy link
Author

The issue is related to my views in the database and during compilation the ViewImports isnt used to add to the namespaces. It works fine in debug mode, but not in Release mode via docker with linux as host.
Is there a way to indicate to the razor view engine options to use the applications _ViewImports file that is in the project when it does a runtime compilation of razor view that is retrieved from the database??

@muratg
Copy link

muratg commented Feb 6, 2018

This issue was moved to aspnet/Razor#2030

@muratg muratg closed this as completed Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants