Majd Albaho
Majd Albaho

Reputation: 1331

No webpage was found for the web address: XXX IIS

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

Answers (1)

er-sho
er-sho

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

Related Questions