为什么.NET6自我含糊的应用程序太慢?
我在.net6中有应用程序,我的部署经理需要它们作为独立的。因此,我已将YAML构建命令更改为以下:
- task: DotNetCoreCLI@2
displayName: Publish service
inputs:
command: publish
projects: <my project>.csproj
publishWebProjects: True
arguments: '--self-contained true --configuration $(BuildConfiguration) --no-restore --output "$(Build.ArtifactStagingDirectory)\service" -p:Version=$(GitVersion.FullSemVer) /p:DebugType=None /p:PublishTrimmed=true /p:PublishSingleFile=true /p:IncludeAllContentForSelfExtract=true /p:InformationalVersion=$(GitVersion.InformationalVersion)'
zipAfterPublish: false
在项目文件中,添加了新元素:
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
和AppSettings.json文件添加了元素:
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
真正产生了一个“单个文件”部署(仅文件:Microsoft.data.sqlclient.sni .pdb位于旁边)。
但是,该应用程序需要大约30分钟!?与非固有的部署相比,反应速度慢了1000倍
有什么问题?请问如何诊断?
感谢您的回答,PETR
I have app in .NET6, my deployment manager needs them as a self-contained. So, I have changed YAML build command to following:
- task: DotNetCoreCLI@2
displayName: Publish service
inputs:
command: publish
projects: <my project>.csproj
publishWebProjects: True
arguments: '--self-contained true --configuration $(BuildConfiguration) --no-restore --output "$(Build.ArtifactStagingDirectory)\service" -p:Version=$(GitVersion.FullSemVer) /p:DebugType=None /p:PublishTrimmed=true /p:PublishSingleFile=true /p:IncludeAllContentForSelfExtract=true /p:InformationalVersion=$(GitVersion.InformationalVersion)'
zipAfterPublish: false
In project file there are added new elements:
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
and appsettings.json files have added elements:
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
There is really produced a "single file" deployment (only file: Microsoft.Data.SqlClient.SNI.pdb lies next to).
But starting of the app takes ~ 30 minutes!? Reactions are 1000 times slower in comparation with non-self-contained deployment
What's wrong? How to diagnose it please?
Thanks for your answers, Petr
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论