Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
Windows 10 Universal App - Type exists in both "Windows.Foundation.UniversalApiContract"

somehow (I have not even done anything) I get many erros in Visual Studio 2015 but I cant understand what the problem really is.

It says that a lot of "types" exists in both "Windows.Foundation.UniversalApiContract" libraries.

Can somebody help me? What can I do to rescue my solution and my project? I've tried to clean and rebuild it sometimes and this doesn't helped.

Errors in Visual Studio 2015

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Looks like you are referencing both the Windows 10 SDK metadata (UAP) and the Windows 8.1 SDK metadata (Windows). Are you mixing old and new binaries, or an old project file? Try to create a new project from scratch and added your sources.

over 4 years ago · Santiago Trujillo Report

0

I ran into something similar:

15178 errors, huh?

It's not fun. I think it started when I accidentally added an extension method to a set of utilities that I keep in a Portable Class Library project that referenced using Windows.ApplicationModel.DataTransfer; , since I (stupidly) added code that accessed the clipboard to the PCL. And that makes some sense; I am now effectively targeting two windows platforms, which is obviously wrong.

Added a few things to the csproj file of that PCL project. First was this line:

 <UseVSHostingProcess>false</UseVSHostingProcess>

The second was this ItemGroup:

 <ItemGroup> <Reference Include="Windows.Foundation.UniversalApiContract"> <HintPath>..\..\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract\2.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath> </Reference> </ItemGroup>

I'm not sure if all of this was necessary, but I removed the clipboard-related code, the reference to Windows.ApplicationModel.DataTransfer; in my using s, and reset/remove the changes to the csproj.

It still had a lot of the same bugs, though. I've found that doing clean rebuilds doesn't always work as expected, so I created a .bat file that I keep in the root of my startup project folder to run when I run into problems. First I have to close the solution in Visual Studio, and then I run...

 cd C:\Projects\solutionName\projectName cd ./bin rmdir x64 /S /Q rmdir x86 /S /Q rmdir ARM /S /Q cd ../obj/ rmdir x64 /S /Q rmdir x86 /S /Q rmdir ARM /S /Q cd .. pause

Now I also have to run that (again, with the solution closed) before building and submitting to the store. I'm not quite sure why, but doing both (removing the non-PCL code and resetting the PCL project and deleting those /bin and /obj folders) fixed the problem.

My unscientific hunch as to why I need to remove /bin and /obj is that VS doesn't always seem to build my projects in dependency order, and often references previous builds of my code when I should have started over. Destroying any possible antiquated crutch seems to force you to do things the right way. ¯\_(ツ)_/¯

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!