英文:
XamlParseException when building in Release with DataGrid
问题
在尝试以发布配置构建Avalonia应用程序时,出现“在使用DataGrid构建发布时出现XamlParseException”错误。在调试模式下工作正常。直接添加Avalonia.Controls.DataGrid NuGet包可以解决问题,但似乎有点奇怪。
英文:
When trying to build Avalonia application in release configuration it crashes with "XamlParseException when building in Release with DataGrid". In debug mode works perfectly
Adding Avalonia.Controls.DataGrid nuget package directly solves problem, but seems a little bit strange
答案1
得分: 1
在进行一些搜索后,我找到了一个解决方案:
在 cproj 文件中,在以下代码之后:
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
只需添加以下行:
<PackageReference Condition="'$(Configuration)' == 'Release'" Include="Avalonia.Controls.DataGrid" Version="0.10.18" />```
<details>
<summary>英文:</summary>
After some search i found a solution:
In cproj file after:
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
Just add the line:
<PackageReference Condition="'$(Configuration)' == 'Release'" Include="Avalonia.Controls.DataGrid" Version="0.10.18" />```
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论