You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
The problem: I need a class library with embedded UI.
Currently it's hard implement such setup when a class library in a solution contains pre-compilable razor views. Lloading views from embedded resource is another option and it works fine.
At the end of the mentioned discussion (#187) there was posted a link to blog post about how to implement embedded UI - https://dzone.com/articles/self-contained-ui-running-one-aspnet-core-mvc-site
It seems to work well. But looks hacky, too much cleaver things should be done in csproj. Another problem it's not documented in official docs.
So this issue is an suggestion to have more simplified approach for "embedded UI", i.e. keeping razor views in class libraries and automatically compile and deploy them.
Some nuances which should be elaborated:
a solution with app and lib both can contain views and identical routes (like "Home/Index")
solution should start with F5/CtrlF5 in VS (views should be compiled and deploy)
on deployment assemblies with pre-compiled views should be deployed correctly
ideally there shouldn't be required to make a library project "runnable" (set Sdk="Microsoft.NET.Sdk.Web" and declare static Main method) but it's not critical indeed, at least it should be documented
Currently (aspnetcore2.0) we have to do the following (thanks to @dasMulli for describing it in this comment - #71 (comment))
As continue of #187
The problem: I need a class library with embedded UI.
Currently it's hard implement such setup when a class library in a solution contains pre-compilable razor views. Lloading views from embedded resource is another option and it works fine.
At the end of the mentioned discussion (#187) there was posted a link to blog post about how to implement embedded UI - https://dzone.com/articles/self-contained-ui-running-one-aspnet-core-mvc-site
It seems to work well. But looks hacky, too much cleaver things should be done in csproj. Another problem it's not documented in official docs.
So this issue is an suggestion to have more simplified approach for "embedded UI", i.e. keeping razor views in class libraries and automatically compile and deploy them.
Some nuances which should be elaborated:
Sdk="Microsoft.NET.Sdk.Web"and declarestatic Mainmethod) but it's not critical indeed, at least it should be documentedCurrently (aspnetcore2.0) we have to do the following (thanks to @dasMulli for describing it in this comment - #71 (comment))
Off the top of my head I'd suggest to introduce
MvcRazorCompile=true.