Describe the bug
I added a WinRTCOMServer exe project and referenced by the WAP project but not the entry project. However, a fake inProcessServer is added to the AppxManifest.xml automatically. Which breaks the build.
Package.appxmanifest
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>MyProject\WinRT.Host.dll</Path>
<ActivatableClass ThreadingModel="both"
ActivatableClassId="MyProjectTask1.TaskCore" />
<ActivatableClass ThreadingModel="both"
ActivatableClassId="MyProjectTask2.TaskCore" />
</InProcessServer>
</Extension>
<Extension Category="windows.activatableClass.outOfProcessServer">
<OutOfProcessServer ServerName="WinRTCOMServer" uap5:IdentityType="activateAsPackage" uap5:RunFullTrust="true">
<Path>WinRTCOMServer\WinRTCOMServer.exe</Path>
<Instancing>multipleInstances</Instancing>
<ActivatableClass ActivatableClassId="WinRTCOMServer.MyClass1" />
<ActivatableClass ActivatableClassId="WinRTCOMServer.MyClass2" />
</OutOfProcessServer>
</Extension>
</Extensions>
AppxManifest.xml
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>MyProject\WinRT.Host.dll</Path>
<ActivatableClass ThreadingModel="both" ActivatableClassId="MyProjectTask1.TaskCore" />
<ActivatableClass ThreadingModel="both" ActivatableClassId="MyProjectTask2.TaskCore" />
</InProcessServer>
</Extension>
<Extension Category="windows.activatableClass.outOfProcessServer">
<OutOfProcessServer ServerName="WinRTCOMServer" uap5:IdentityType="activateAsPackage" uap5:RunFullTrust="true">
<Path>WinRTCOMServer\WinRTCOMServer.exe</Path>
<Instancing>multipleInstances</Instancing>
<ActivatableClass ActivatableClassId="WinRTCOMServer.MyClass1" />
<ActivatableClass ActivatableClassId="WinRTCOMServer.MyClass2" />
</OutOfProcessServer>
</Extension>
<!--Fake inProcessServer that created automatically-->
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>WinRTCOMServer\WinRTCOMServer.dll</Path>
</InProcessServer>
</Extension>
</Extensions>
This issue seems related to the Target RemoveWinMDRefForManifestAutoGen in the wapproj.
Therefore, the workaround below would fixed that
<Target Name="RemoveOutOfProcWinMD" BeforeTargets="_GenerateCurrentProjectAppxManifest">
<ItemGroup>
<_AppxWinmdFilesToHarvest Condition="'%(FileName)' == 'WinRTCOMServer'" Remove="@(_AppxWinmdFilesToHarvest)" />
</ItemGroup>
</Target>
Steps to reproduce the bug
- Create a WinRT COM Exe Server like this, and reference the project from WAP project. No need to set as entry project.
WinRTCOMServer
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<SelfContained>true</SelfContained>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>WinRTCOMServer</RootNamespace>
<CsWin32RunAsBuildTask>true</CsWin32RunAsBuildTask>
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
<LangVersion>latest</LangVersion>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'ARM64'">win-arm64</RuntimeIdentifier>
<AssetTargetFallback>net10.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
</PropertyGroup>
<PropertyGroup Label="CsWinRTInformation">
<CsWinRTComponent>true</CsWinRTComponent>
<CsWinRTWindowsMetadata>$(TargetWindowsVersion)</CsWinRTWindowsMetadata>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.CsWinRT">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
- Build the WAP project
- Find the
error APPX0501: Validation error. error C00CE012: App manifest validation error: The app manifest must be valid as per schema: Line 115, Column 8
Expected behavior
Do not generate a fake inProcessServer entry in the Appxmanifest.xml automotically.
Screenshots
No response
NuGet package version
1.8.260317003
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 24H2 (26100, June 2025 Update)
IDE
Visual Studio 2022
Additional context
No response
Describe the bug
I added a WinRTCOMServer exe project and referenced by the WAP project but not the entry project. However, a fake
inProcessServeris added to the AppxManifest.xml automatically. Which breaks the build.Package.appxmanifest
AppxManifest.xml
This issue seems related to the Target
RemoveWinMDRefForManifestAutoGenin the wapproj.Therefore, the workaround below would fixed that
Steps to reproduce the bug
WinRTCOMServer
error APPX0501: Validation error. error C00CE012: App manifest validation error: The app manifest must be valid as per schema: Line 115, Column 8Expected behavior
Do not generate a fake
inProcessServerentry in the Appxmanifest.xml automotically.Screenshots
No response
NuGet package version
1.8.260317003
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 24H2 (26100, June 2025 Update)
IDE
Visual Studio 2022
Additional context
No response