MVC 区域不呈现 _Layout [英] MVC Areas not render _Layout
本文介绍了MVC 区域不呈现 _Layout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有 .NET CORE 2.2 的 MVC 项目
我在我的项目中添加了区域,它在本地机器上正常工作.
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 管道.我注意到我的区域渲染不正确,以下来自 azurewebsites.
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="AreasAdminViews\_ViewImports.cshtml" />
<Content Remove="AreasAdminViews\_ViewStart.cshtml" />
<Content Remove="AreasAdminViewsShared\_Layout.cshtml" />
<Content Remove="ViewsShared\_Layout.cshtml" />
</ItemGroup>
这篇关于MVC 区域不呈现 _Layout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文