问题
I'm currently working on an demo application of ASP.NET Core 2.1
.
I try to use the new RCL
(Razor class Library
) in my ASP.NET Core MVC application.
I have 2 projects in my Solution
- Project 1 : ASP.NET Core MVC application
- Project 2 : Razor Class Library(MVC)
The structure of my Razor Class Library is very simple:
- Areas
- MyFeature
- Views
- Shared
- _Layout.cshtml
- Shared
- Views
- MyFeature
↓ This is the source code of _ViewStart.cshtml
in the project 1 ( ASP.NET Core MVC application)
@{
Layout = "/Areas/MyFeature/Views/Shared/_Layout.cshtml";
}
Steps to reproduce the issue :
- Build Razor Class Library(MVC)
- within Project 1( ASP.NET CORE MVC application) , add reference to
.dll
,view.dll
generated by step 1 , . - Excludes dependencies on Project 2 (
RCL
). - Within Visual Studio , unload the Project 2 (RCL).
- Build Project 1 (ASP.NET CORE MVC application).
- The results are shown below.

Why do such errors occur?
I've upload my Project file on Google Drive (DownLoad Link)
I want to encrypt files in Razor Class Library(MVC) .
Please tell me if my method is wrong or the steps are wrong.
I'll be looking forward to reply.
来源:https://stackoverflow.com/questions/52732801/unable-to-find-the-path-to-the-view-cshtml-file-in-the-razor-class-librarythe-r