asp.net core2.0中网站发布的时候,视图文件不被打包成dll
项目csproj文件里面加
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish> </PropertyGroup> </Project>
加入MvcRazorCompileOnPublish=false这句。
具体请参考
https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?tabs=aspnetcore2x