MVC区域未呈现_Layout [英] MVC Areas not render _Layout

查看:64
本文介绍了MVC区域未呈现_Layout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有带有.NET CORE 2.2的MVC项目.
我在我的项目中添加了Areas,当它在本地计算机上时,它可以正常工作.

I have the MVC project with .NET CORE 2.2
I add Areas in my project it work properly when in the local machine.

成功发布应用程序后,我使用Azure Devops设置了CI CD管道.我注意到我的区域无法正确渲染,这是来自azure网站的.

I setup CI CD pipeline with Azure Devops, when the application is published successfully. I notice my Areas is not render properly, this below is from azurewebsites.

以下是我在本地调试时显示的内容,有人可以帮忙吗?哪里出了错

推荐答案

问题在.csproj上.此行包括在内,我不知道它如何在csproj中添加.但是当我从csproj中移除后,它可以正常工作.

The issue is on .csproj It include this line, i got no idea how it add this in csproj. but when i removed from the csproj it work properly.

<ItemGroup>
    <Content Remove="Areas\Admin\Views\_ViewImports.cshtml" />
    <Content Remove="Areas\Admin\Views\_ViewStart.cshtml" />
    <Content Remove="Areas\Admin\Views\Shared\_Layout.cshtml" />
    <Content Remove="Views\Shared\_Layout.cshtml" />
  </ItemGroup>

这篇关于MVC区域未呈现_Layout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆