Deleting PrecompiledViews.dll from ASP.Net Core 2 API

前端 未结 1 690
清歌不尽
清歌不尽 2021-01-24 16:17

In .NET Core 2 Web API app, Publish to folder feature in MS VS 2017 produce:

.PrecompiledViews.dll
.PrecompiledView         


        
相关标签:
1条回答
  • 2021-01-24 17:07

    You are right, the precompile step always emits an assembly and doesn't check if there are actually views. You can disable the precompilation step by putting this into your csproj file:

    <PropertyGroup>
      <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
    </PropertyGroup>
    

    This will then activate the normal copilation context preservation (refs subfolder). To deactivate this as well, add

    <PreserveCompilationContext>false</PreserveCompilationContext>
    

    to the property group.

    0 讨论(0)
提交回复
热议问题