0

I have three projects:

  1. WebBase => this project contains _ViewImports.cshtml and is an RCL project.
  2. Galleries => this project is a module, that uses WebBase for some common base things, and also contains items related to galleries. And it is also an RCL project.
  3. SiteBuilder => this is my orchestrator project, that combines all modules together in one panel.

Now, the problem is that my _ViewImports.cshtml which is in WebBase is not recognized by compiler in my Galleries project. Thus my <partial> tags are not rendered. And I have to copy/paste that _ViewImports.cshtml to the Galleries projects too.

How can I reuse _ViewImports.cshtml?

1 Answers1

1

The purpose of the _ViewImports.cshtml file is to provide a mechanism to make directives available to Razor pages globally in one project so that you don't have to add them to pages individually. Therefore, you cannot share them across multiple projects.

Majid Shahabfar
  • 4,010
  • 2
  • 28
  • 36