Reputation: 1331
I had created an Asp.NET Core Web Application My app is running on debug 100%, But on publish and host on my server. the views in subfolder are not found
-- Structure:
Views
-- Setting
---- Donors --> views in this folder are not found on IIS
---- Facility --> views in this folder are not found on IIS
Upvotes: 0
Views: 2491
Reputation: 9771
1) The ape.net core 2.x project have by default MvcRazorCompileOnPublish
to true
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup>
if you look at publish output folder you will see the dll with name .PrecompiledViews.dll
and this dll contains all your views.
2) If you want to forcefully publish your views then edit your .csproj
file and modify below lines
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
</PropertyGroup>
By this modification you will see all your views to your publish folder.
Upvotes: 1