Razor Layout from another assembly

前端 未结 2 448
说谎
说谎 2021-01-18 15:24

Is it possible to use a layout from another assembly? I spitted up my application in different layers and have a separated UI layer which contains the master layout for the

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-18 16:10

    At the end by the time you run the website, you need to gather all the views including layouts to a known place.

    In this case you can copy the shared views under root

    /Views/Shared/
    

    With this assumption you can refer these layouts the way you are doing. However visual studio or tools like resharper keep showing this as an error. You need to get comfortable with those errors.

提交回复
热议问题