I reported in the mean time an error on the Visual Studio Developer web site.
See here.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Error MSB4018 The "GenerateDepsFile" task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.NET.Build.Tasks.SingleProjectInfo.CreateProjectReferenceInfos(IEnumerable1 referencePaths, IEnumerable1 referenceSatellitePaths, Func`2 isRuntimeAssembly)
at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath)
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.NET.Build.Tasks.TaskWithAssemblyResolveHooks.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I reported in the mean time an error on the Visual Studio Developer web site.
See here.
I have the same issue. It occurs when you add a OOP background task to a solution where both the background project and the WINUI-exe project needs references to the same 'library' projects inside the solution.
In a WinUI/WindowsAppSdk desktop app a OOP background task must be defined in a seperate CsWinRTComponent library project (to add the WinRT.Host dlls) and the exe project must reference the background task project in order bring everything together in the app. Unless one copies the necessary code from the shared libraries into the background project I don't see any way to solve this. That of course is ridiculous.
Did you find a solution in the mean time to overcome this?
Hi Roman,
I am Dave, I will help you with this.
I apologize, Community is just a consumer forum, due to the scope of your question can you please post this question to our sister forum on Microsoft Q&A (The Software Developers Forum)
Over there you will have access to a host of developers and programming experts and will get a knowledgeable and quick answer to this question.