You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
warning MSB8027: Two or more files with the name of WindowsAppRuntimeAutoInitializer.cpp will produce outputs to the same location.Β #5395
I got this warning in my project. Later it is followed by this warning:
WindowsAppRuntimeAutoInitializer.obj : warning LNK4042: object specified more than once; extras ignored
The solution consist of (among others) two c++ projects: exe and dll - both are using the same version WindowsAppSDK (1.7.250401001) nuget.
I think it is caused by WindowsAppSDK nuget that has WindowsAppSDK-Nuget-Native.AutoInitializer.targets
in buildTransitive directory. Also I think older versions of WindowsAppSDK haven't produced such warnings.
Is there a way to prevent the warnings?
Reacted by HO-COOH, Aleksi Sohlman, LB-- and ekalchev
Still no update? I try to use new version of WindowsAppSDK (1.7.250513003) and the result is still the same. Additionaly new warning appeared: xxx\Microsoft.Common.CurrentVersion.targets(2434,5): warning MSB3106: Assembly strong name "xxx\Microsoft.Windows.AI.Foundation.winmd" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\).
There is no warning while using WindowsAppSDK 1.6.240923002.
I even prepared sample solution where you can reproduce the error.
It looks like the premise is wrong - the Target is attempting to add a ClCompile Item, and is using %(PreprocessorDefinitions)/%(ClCompile.PreprocessorDefinitions) to do so. But that's ItemDefinitionGroup-syntax for accessing the previously defined metadata values, and isn't valid in an ItemGroup. Infact, within a Task, the %(PreprocessorDefinitions)-syntax will cause Task batching, which will call the Task (i.e. CreateItem) once per 'set' of PreprocessorDefinitions, which is presumably why we're getting multiple ClCompile items.
Any update on this? The "duplicate 'WindowsAppRuntimeAutoInitializer.cpp' compilation" is still present in almost every build even under just released WinAppSDK 2.0.1 Stable... Looking at closed link I have hoped it is fixed.
Activity
PetrMinar commentedon May 22, 2025
Still no update? I try to use new version of WindowsAppSDK (1.7.250513003) and the result is still the same. Additionaly new warning appeared:
xxx\Microsoft.Common.CurrentVersion.targets(2434,5): warning MSB3106: Assembly strong name "xxx\Microsoft.Windows.AI.Foundation.winmd" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\).There is no warning while using WindowsAppSDK 1.6.240923002.
I even prepared sample solution where you can reproduce the error.
ssparach commentedon Sep 2, 2025
Reopening issue. See #5760 for more information.
mschofie commentedon Oct 7, 2025
Just qualifying the metadata access appears to fix things for me. i.e. converting:
To:
mschofie commentedon Oct 7, 2025
Sorry, that only removed some of the problems... Still looking...
mschofie commentedon Oct 7, 2025
It looks like the premise is wrong - the Target is attempting to add a
ClCompileItem, and is using%(PreprocessorDefinitions)/%(ClCompile.PreprocessorDefinitions)to do so. But that'sItemDefinitionGroup-syntax for accessing the previously defined metadata values, and isn't valid in an ItemGroup. Infact, within a Task, the%(PreprocessorDefinitions)-syntax will cause Task batching, which will call the Task (i.e. CreateItem) once per 'set' ofPreprocessorDefinitions, which is presumably why we're getting multiple ClCompile items.PetrMinar commentedon Apr 30, 2026
Any update on this? The "duplicate 'WindowsAppRuntimeAutoInitializer.cpp' compilation" is still present in almost every build even under just released WinAppSDK 2.0.1 Stable... Looking at closed link I have hoped it is fixed.
agniuks commentedon May 12, 2026
Fixed in 1.8.8, and a fix is coming to 2.0-stable next week.
build: gate multi-arch host aggregation and full incremental build (#3)
lauren-ciha commentedon Oct 21, 2026
The fix for this issue was shipped in 1.8.8 and 2.0, so I am closing this as completed.