Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does MSBuild:UpdateDesignTimeXaml do?

I have started a new Xamarin.forms project and added some xaml files. I have noticed that in the .csproj file it adds:

  <ItemGroup>
    <EmbeddedResource Update="View.xaml">
      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
    </EmbeddedResource>
  </ItemGroup>

What does this actually do?

Should I remove it?

Should it be <Generator>MSBuild:Compile</Generator> ?

like image 286
Iain Smith Avatar asked May 03 '19 15:05

Iain Smith


1 Answers

The task of MSBuild:Compile was the really old way Forms updated your XAML/.cs files for the IDE.

i.e. This design-time background process generates the *.g.cs file(s) that contain your project's generated partial classes that are used to provide the IntelliSense with the IDE for your XAML code-behind.

In the Xamarin.Forms release of 1.3?/1.4? (not sure of the exact version as it was quite a while ago), Xamarin added the MSbuild task of UpdateDesignTimeXaml so the entire project did not have to be built in the background to update the XXXX.g.cs file for the partial class generation and thus updates happen very quickly as just those changed generated files are fed to Roslyn for the IntelliSense feature.

like image 56
SushiHangover Avatar answered Nov 19 '22 03:11

SushiHangover