Asp.Net Core MVC发布时不打包视图文件

.Net Core 3.1之前

文档发布时,选择文档发布,打开Properties/PublishProfiles/FolderProfile.pubxml 发布配置文件,添加属性

<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>

在这里插入图片描述

.Net Core 3.1

修改Host项目的csproj文件的PropertyGroup节点下,添加属性:

<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Helloantoherday/article/details/120425753