Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

80080204: App manifest validation error during building XamlIsland apps #328

Open
michalleptuch opened this issue Sep 15, 2021 · 19 comments
Labels
bug 🐛 Something isn't working XamlIslands 🏝️

Comments

@michalleptuch
Copy link

michalleptuch commented Sep 15, 2021

Describe the bug

I can't build my XamlIsland apps in Visual Studio 2019 v16.10 and higher. Even Visual Studio 2022 Preview doesn't handle it. Visual Studio 2019 v16.9.8 is the last tested and working version.

Error	APPX0501	Validation error. error 80080204: App manifest validation error: Line 66, Column 27, Reason: The field "*[local-name()='Extensions']/*[local-name()='Extension']/*[local-name()='InProcessServer']/*[local-name()='ActivatableClass']" with value "Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication" must only be declared once. A duplicate exists on Line 60, Column 27.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Clone this repo: https://github.com/michalleptuch/rounded-flyout
  2. Open in VS and try to build

Expected behavior

Correctly building of solution

Environment

Project .NET Version:
-  .NET Core 3.1

Packages:
- Microsoft.Toolkit.Win32.UI.XamlApplication (6.0.0-6.1.3)

Windows 10 Build Number:
- 18362-22000

App min and target version:
- 18362-22000

Device form factor:
- Desktop

Visual Studio 
- 2019 (version: 16.10.x) 
- 2022 Preview (version: 17.0)
- 2022

Additional context

I found similar issues that describe the same situations but solutions don't work for me:

@michalleptuch michalleptuch added the bug 🐛 Something isn't working label Sep 15, 2021
@ghost ghost added the needs triage 🔍 label Sep 15, 2021
@ghost
Copy link

ghost commented Sep 15, 2021

Hello michalleptuch, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@michalleptuch michalleptuch changed the title 80080204: App manifest validation error during building of XamlIsland apps 80080204: App manifest validation error during building XamlIsland apps Sep 15, 2021
@ghost ghost added the needs attention 👋 label Nov 3, 2021
@ghost
Copy link

ghost commented Nov 3, 2021

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

1 similar comment
@ghost
Copy link

ghost commented Nov 18, 2021

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@michael-hawker
Copy link
Member

FYI @marb2000 @ocalvo

@Samuel12321
Copy link

The ModernFlyouts Team is also experiencing this issue.
This is a major breaking bug that has had no solution for 4 months.
@marb2000 @ocalvo @michael-hawker

@atiyka
Copy link

atiyka commented Jan 10, 2022

I also experienced the same issue when I updated the VisualStudio2019. As a temporal solution I had to go back to the previous version and I can't upgrade until this bug won't be fixed.

@michael-hawker
Copy link
Member

Has anyone filed a new issue with the Visual Studio team for this regression? If so, can they link to that issue here?

@Samuel12321
Copy link

Has been reported here https://developercommunity2.visualstudio.com/t/Visual-Studio-16100-breaks-support-for/1634426?q=microsoft.toolkit&ftype=problem&space=8&stateGroup=active&sort=newest

@Samuel12321
Copy link

@ocalvo
Copy link
Contributor

ocalvo commented Jan 24, 2022

It seems that the toolkit msbuild code that detects if the Xaml Applicaton dll has been added already is now not detecting it and ends up adding 2 entries of the same dll.

@ocalvo
Copy link
Contributor

ocalvo commented Jan 24, 2022

Please replace this section of your wap project as follows:

  <ItemGroup>
    <ProjectReference Include="..\RoundedFlyout.Uwp\RoundedFlyout.Uwp.csproj" />
    <ProjectReference Include="..\RoundedFlyout.Wpf\RoundedFlyout.Wpf.csproj" />
  </ItemGroup>
  <Target Name="_RemoveWinMDFromAppxManifest" BeforeTargets="_GenerateCurrentProjectAppxManifest">
    <ItemGroup>
      <_AppxWinmdFilesToHarvest Remove="@(_AppxWinmdFilesToHarvest)" />
    </ItemGroup>
  </Target>
  <Target Name="_StompSourceProjectForWapProject" BeforeTargets="_ConvertItems">
    <ItemGroup>
      <_TemporaryFilteredWapProjOutput Include="@(_FilteredNonWapProjProjectOutput)" />
      <_FilteredNonWapProjProjectOutput Remove="@(_TemporaryFilteredWapProjOutput)" />
      <_FilteredNonWapProjProjectOutput Include="@(_TemporaryFilteredWapProjOutput)">
        <SourceProject>
        </SourceProject>
      </_FilteredNonWapProjProjectOutput>
      <_DetailedPriXml Remove="@(_DetailedPriXml)" />
    </ItemGroup>
  </Target>

@Samuel12321
Copy link

Seems to work, Thanks @ocalvo.
When should we expect this to be properly fixed?

@michalleptuch
Copy link
Author

@ocalvo Yes, it works for building, but during packaging app for the Store I get this error:

1>PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry.
1>PRI222: 0x80073b0f - Unspecified error occurred.

Branch: FixForVS

@atiyka
Copy link

atiyka commented Feb 15, 2022

Thank you @ocalvo, it works for me as well

@atiyka
Copy link

atiyka commented Feb 22, 2022

@ocalvo, after I added your suggestion to the project, I submitted the build to the Store, but the certification process did not start at all. After 4 days of waiting we received an email from the support:
The submission has been cancelled due to an invalid package. Error details: Error: DirectWriteForwarder : Gatekeeper error GK0028 : GK0028 Assembly ‘DirectWriteForwarder’ is a mixed mode assembly containing managed and native code. Only pure managed assemblies are compatible with .NET Native.
I reverted this change, created an app package with an older VS 2019 (16.9.1) and tried to submit to the store. Almost immediatelly started the certification process, so I think this workaround cause the issue.

Do you have any idea?

@michalleptuch
Copy link
Author

@atiyka How did you create an app package? I stucked on this #328 (comment).

@atiyka
Copy link

atiyka commented Mar 1, 2022

Well, I just added the code above (except the first 4 lines) at the end of the .wapproj file in the UWP project before the closing </Project> tag. It created the app package without any issues for the packaging project in VS.

@Samuel12321
Copy link

This is a major breaking bug that has been a problem for 6 months now. Any eta on when we can expect an official solution / patch shipped?
@marb2000 @ocalvo @michael-hawker

@aquinn39
Copy link

Also reported here: MicrosoftDocs/windows-dev-docs#3544. This issue still exists in the latest version of Visual Studio 2022 unfortunately so I'm still stuck using Visual Studio 2019 16.9.8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something isn't working XamlIslands 🏝️
Projects
None yet
Development

No branches or pull requests

7 participants
@ocalvo @atiyka @michael-hawker @Samuel12321 @michalleptuch @aquinn39 and others