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 #2030

Closed
muratg opened this issue Feb 6, 2018 · 3 comments

Comments

@muratg
Copy link

muratg commented Feb 6, 2018

From @joetherod on January 27, 2018 16:35

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.

#715 (comment)

Please help.

Copied from original issue: aspnet/Hosting#1319

@muratg
Copy link
Author

muratg commented Feb 6, 2018

From @joetherod on January 27, 2018 19:57

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??

@mkArtakMSFT
Copy link
Contributor

@pranavkm can you please look into this?

@mkArtakMSFT
Copy link
Contributor

Looks like this is a dupe of #1984.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants