Recently I migrated my asp.net core 3.1 web app to NET6. Before migration, I didn't have this kind of problems. My web app has several projects (DLL) and some of them have Views and Controllers due to requirements. I marked those projects as Skd.Razor as shown below:
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>
I configured Startup to recognize those controllers and views by using application parts:
Each project has its own _ViewImports.cshtml including Main Project SicotX:
The problem comes out when I'm trying to publish the application, compilation is generating the following error
_ViewImports.cshtml is causing conflicts in the output path in both projects except the main SiotX project.
I need to use _ViewImports into those projects so I need your help or guide how to overcome this issue is blocking me, or maybe is it possible to use a unique _ViewImports.cshtml and share with all projects?
Thanks