Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda