microsoft-ui-xaml: error MSB4181: The "CompileXaml" task returned false but did not log

This issue has been moved from a ticket on Developer Community.


[severity:I’m frustrated, but able to complete my work] [regression] “worked-in:actual on July 9, 2020” The studio breaks its teeth on this fragment:

<Button.Content>
    <StackPanel Orientation="Horizontal">
        <TextBlock FontSize="20" Text="⏱" />
        <ProgressRing Name="StopwatchIndic" Margin="5,0,0,0" IsActive="True" Visibility="Visible" />
    </StackPanel>

When you try to assemble a project in any of the modes (debug/release-x86/x64) everything goes well, but when you build a package for the store immediately for x86 x64 I receive an error message. It is often accompanied by reports that StopwatchIndic has not been included in the xaml.cs file. This ugliness occurs on two computers and two Studios - 16.6.5 and 16.7.0 Preview 5. “Recovery” Studio does not help to solve the problem.


Original Comments

Feedback Bot on 7/26/2020, 11:14 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 32 (10 by maintainers)

Most upvoted comments

@AnriaruDoragon I put the text of the error into Google Translate, and it said something about the configurations being incorrect (trying to build arm, but you should choose x64 or x86) - this might be a red herring based off what properties you pass into msbuild. Can you please get logs in English next time? There isn’t much I can do with logs that are in Russian.

@Gavin-Williams can you follow the steps here for collecting binlogs through VS? https://github.com/microsoft/microsoft-ui-xaml/blob/master/docs/debugging_buildfailures.md#collecting-binlogs-through-visual-studio

@chungweileong94 and @AnriaruDoragon if you could share either repro project or binlog that would be incredibly helpful.

To get an appropriate binlog that simulates building for the store, you can build your project from a Developer Command prompt with this command: msbuild /p:AppxBundlePlatforms=x86 /p:Platform=x86 /p:Configuration=Release /p:BuildAppxUploadPackageForUap=true /bl

If you do this, does the issue reproduce ? If so, please upload the msbuild.binlog file that is created.

@stevenbrix I tried to build a project using this command, no errors occurred, the project was built and works, but when I try to pack it again from menu, it gives the same error, deleting the /obj still solves this problem. For some reason, the studio does not update the generated code after changes during packaging.

Here is the repository, in the readme I described the versions and how to get this error. AnriaruDoragon/UWP-MSB4181-CompileXaml

The first time the error occurred was in another project, I created a new one to specifically cause this error.

Hmm, @chungweileong94 what version of WinUI 2 are you using?

@ranjeshj @and @llongley or maybe @jevansaks. Does the fix of deleting the /obj directory point to something in our packaging being broken?