Xaml 实时编辑不适用于自定义解决方案配置



在VisualStudio 2017中,从任何新的解决方案中,我们都有两种经典配置:DebugRelease

我添加了一些其他自定义配置,Xaml Live 编辑器在任何页面中都找不到任何要更新的元素,但使用Debug配置,它运行良好。

我找不到任何东西或任何关键字来找到我的答案,所以我在这里问。

这已经在这里得到了解答: 开发者社区

叶甫根尼 ·11月 01 在 02:19 下午

感谢您的反馈!您需要在配置中将 XamlDebuggingInformation msbuild 属性设置为 true ( https://learn.microsoft.com/en-us/dotnet/api/microsoft.build.tasks.windows.markupcompilepass1.xamldebugginginformation (。默认情况下,它是

<XamlDebuggingInformation Condition="'$(XamlDebuggingInformation)' == '' and '$(ConfigurationName)' == 'Debug'">true</XamlDebuggingInformation>

不建议将其用于发布配置,因为它会增加 通过嵌入文件名、行和列信息来调整程序集的大小 XAML 文件中的每个元素。

编辑

上述解决方案适用于WPF

对于UWP,将其放入项目的.csproj(在Project标记下(

<PropertyGroup>
<!-- XAML DEBUG INFOs -->
<DisableXbfLineInfo Condition="'$(ConfigurationName)' != 'Release'">false</DisableXbfLineInfo>
</PropertyGroup>

最新更新