title: How do I add XamlDebuggingInformation MSBuild property to CsProj?
body: <p><a href="https://docs.microsoft.com/en-us/visualstudio/xaml-tools/xaml-hot-reload-troubleshooting?view=vs-2019" rel="nofollow noreferrer">This page</a> from Microsoft about trubleshooting XAML Hot reload says this:</p>
  <blockquote>
  <p>By default, source info is included in a Debug configuration. It is controlled by MSBuild properties in your project files (such as *.csproj). For WPF, the property is XamlDebuggingInformation, which must be set to True. For UWP, the property is DisableXbfLineInfo, which must be set to False. For example:</p>
  <p>WPF: <code>&lt;XamlDebuggingInformation&gt;True&lt;/XamlDebuggingInformation&gt;</code></p>
  <p>UWP: <code>&lt;DisableXbfLineInfo&gt;False&lt;/DisableXbfLineInfo&gt;</code></p>
  </blockquote>
  <p>Since my project configuration name isn't &quot;Debug&quot; the hot reload property is not automatically in my MSBuild configuration and as you can see Microsoft recommend that I add <code>XamlDebuggingInformation</code> to my .csProj in order to get XAML hotreloading to work but I have no idea how todo that.</p>
  <p>I tried just adding a new line into the <code>&lt;PropertyGroup&gt;</code> tag that had the configuration I wanted to apply but then Visual Studio had a very hard time loading after that. How do I add this MSBuild property?</p>
  <p>Example of csproj file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;Project ToolsVersion=&quot;16.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
    &lt;Import Project=&quot;$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props&quot; Condition=&quot;Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')&quot; /&gt;
    &lt;PropertyGroup&gt;
      &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
      &lt;ProjectGuid&gt;{1EA7A7EC-D092-4DE3-B8DD-49F74B71ACF2}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;WinExe&lt;/OutputType&gt;
      &lt;RootNamespace&gt;PatchDeDup&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;PatchDeDup&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.7&lt;/TargetFrameworkVersion&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
      &lt;ProjectTypeGuids&gt;{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/ProjectTypeGuids&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
      &lt;AutoGenerateBindingRedirects&gt;true&lt;/AutoGenerateBindingRedirects&gt;
      &lt;Deterministic&gt;true&lt;/Deterministic&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Release|AnyCPU' &quot;&gt;
      &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
      &lt;Optimize&gt;true&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=&quot;'$(Configuration)|$(Platform)' == 'OtherDebug|AnyCPU'&quot;&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;OutputPath&gt;bin\OtherDebug\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
      &lt;DebugType&gt;full&lt;/DebugType&gt;
      &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;CodeAnalysisRuleSet&gt;MinimumRecommendedRules.ruleset&lt;/CodeAnalysisRuleSet&gt;
      &lt;Prefer32Bit&gt;true&lt;/Prefer32Bit&gt;
    &lt;/PropertyGroup&gt;
    ... file includes, dependency references, etc. (pretty generic wpf project stuff)
  </code></pre>
  <p>I assumed that I'd have to add <code>&lt;XamlDebuggingInformation&gt;True&lt;/XamlDebuggingInformation&gt;</code> inside the <code>PropertyGroup</code> for the <code>OtherDebug|AnyCPU</code> but VS 2019 doesn't expect that apparently...</p>