Visual Studio error: There was a conflict between two files - windows

I have an UWP app in the Windows Store, and I was now preparing an update and when I do: Project> Store> Create App Packages and when it starts the process appear 13 warnings and are almost all the same. The warning is this:
There was a conflict between two files. There was a conflict between two references with the same file name between the "WindowsMobile, Version=10.0.10240.0" and "WindowsMobile, Version=10.0.14393.0" SDKs. Choosing "C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.Sockets.ControlChannelTriggerContract\1.0.0.0\Windows.Networking.Sockets.ControlChannelTriggerContract.winmd" over "C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.Sockets.ControlChannelTriggerContract\2.0.0.0\Windows.Networking.Sockets.ControlChannelTriggerContract.winmd" because it was resolved first.
What error is this? How do I solve it?
I already looked for a resolution and I can not find anything. This error never appeared!

You're referencing 2 different versions of the WindowsMobile SDK:
Version=10.0.10240.0
Version=10.0.14939.0
This creates a conflict when building the solution.
Ensure that all your projects reference the same version of the SDK.

Related

Libjna build - LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'

I'm re-posting an issue from github (https://github.com/libffi/libffi/issues/538) I had since last week.
I'm currently having issue getting some JNA libraries built as jar deployables using Ant build script (FYI: https://github.com/thepaul/libjna-java). in order to use the APIs from this library for my other project. (The sole purpose of me going through the hassle building it is to be able to use its API. Due to lack of documentation and absence of existing build artifact provided, I had to do it myself. Importing the whole libjna repo as a project into my other project maybe another approach but I don't think it's appropriate. That said, if there're any better ways to use the libraries in libjna, do let me know!)
So here's what I did trying to build it into deployable jar file:
I already have the source project downloaded.
Tried to compile using Ant (which I downloaded the latest version) on cygwin. Failed because it requires libffi.
So I downloaded libffi source from here (https://github.com/libffi/libffi).
Tried to compile again using Ant. Failed because it couldn't find "/c/Program Files (x86)/Microsoft Visual Studio 9.0/vc/bin/cl" as mentioned in the config.log
So I inspected cc.sh and found that it refers to an older version of Microsoft Visual Studio. I have an existing installation of Visual Studio Express. So I changed the path to "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64" in cc.sh file.
Tried to complile again using Ant. Seemed the fix worked but failed with different error because it couldn't find "mspdbcore.dll". I found this file in "..\x86" so I copy the file across to ..\x64
Tried to compile again using Ant. Failed with similar error but different file because it couldn't find "mspdb140.dll". I found this file in "..\x86" so I copied over
Tried to compile again. Failed with different error because now it says
"LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'"
, although I could confirm this file is definitely in "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64"
To tackle this error I tried (in vain):
adding microsoft visual studio paths to PATH
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64
C:\Program Files (x86)\Microsoft Visual
Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\Common7\IDE
Downloaded MS Visual Studio 2019 both Community and Professional (couldn't find those dlls for some reason)
Downloaded both mspdb140.dll and mspdbcore.dll separately, config.log says it can't find these files
Note I also did some research online, however:
I don't use visual studio IDE as I"m only trying to build it with Ant, so this post didn't really help much (LINK: fatal error LNK 1104: cannot open file 'LIBCMT.lib')
I don't really understand the answer to this post either (https://social.msdn.microsoft.com/Forums/en-US/cbedc1ba-c50b-499e-aa2e-12b0ce6a40ba/lnk1104-cannot-open-file-libcmtlib?forum=vclanguage)
So this is where I'm stuck.
See latest config log attached.
config.log
Also Ant build log attached.
ant_compile_error.txt
Anyone can help would be much appreciated!
Cheers
Dale

Nuget Restore in a Docker Container

I am trying run nuget restore mySolution.sln in a docker container.
For the most part it seems to work just fine. The packages seem to restore fine, but before they do, it shows this error:
C:\src\myProject\mySolution.csproj(317,11):
error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found.
Also, tried to find "WebApplications\Microsoft.WebApplication.targets" in the fallback search path(s) for $(VSToolsPath)
- "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" .
These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\msbuild.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths.
From what I read, this means I need the nuget package MSBuild.Microsoft.VisualStudio.Web.targets. I did a nuget install of that, but the error does not go away. (It just drops it where ever I run it. I tried putting it with my solution and in the packages folder. Neither had any effect.)
How can I fix this error using command line tools? (No GUI because this is a docker container).
I assume what you're trying to build is a web-application, but you haven't installed corresponding workloads in your build tools package.And that's the cause of this issue. (Agree with imps)
Open the Visual Studio Installer in Start menu and you can modify the workloads of your msbuild package:
I only use the msbuild build tools package to build C++ desktop projects in server, so I only install the Visual C++ build tools workload. For you, you have to install the build tools for Web applications so that you can get the necessary files to build web-applications.
Update:
error: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found.
After I install the Web development build tools, I now get the newly created WebApplications folder in path C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0.

Change of behavior of tracewpp between versions 10.0.15063.0 and 10.0.17134.0 of Windows SDK

I have an application relying on user mode tracing via wpp framework. However, Microsoft introduced some changes in the couple of latest version of Windows SDK which broke the tracewpp.exe tool somehow. The actual problem I'm seeing looks as following:
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\tracewpp.exe" ... more args ...
Works as expected (I have checked older versions of SDK, down to 8.0 - all nice and good).
However, when I try to perform the same build with newer version of the SDK the build breaks with a rather cryptic error:
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\tracewpp.exe" ... all the same args ...
Results in:
provider.tpl(0) : error wpp : (Template::DoId) Var not found: Provider
tracewpp(0) : error wpp : (RealMain) Fatal error: Template parse error
The template in question originally comes from here: https://github.com/antoxar/WPPTracingSample/blob/master/sample/WppTracing/WppConfig/Rev1/provider.tpl
Can somebody point me at the change log for the tracewpp.exe tool, outlining what changes were done to it recently or otherwise shed light on the above issue?
I had the same problem and solved it. In my case Microsoft Visual Studio 2017 was using the 10.0.17763.0 SDK and running the WPP tools in:
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\
But my tracewpp command was referring to an older "WppConfig\Rev1" directory. The newer tools expected a different provider.tpl configuration. I had these various version installed, and was referring to an older version (the last one) instead of the matching "17763" one.
C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\WppConfig\Rev1
C:\Program Files (x86)\Windows Kits\10\bin\WppConfig\Rev1
If using a Pre-Build step in Visual Stdio, changing the path from $(WindowsSdkDir) to $(WDKBinRoot) worked for me (your other options may vary):
tracewpp -I"$(WDKBinRoot)\WppConfig\Rev1" -odir:$(IntDir) -scan:Trace.h *.cpp
As an aside, a Debug build of my project failed as well. Make sure to use the compiler flag /Zi if you want debug symbols instead of /Zl (Debug with Edit and Continue). wpptrace doesn't support it.

Where can I find the Windows header files

Sometimes in my research into Microsoft functions, I'll see the name of a constant and perhaps a reference to a header file - like winuser.h. I don't often need to refer to them but when I do, I wind up spending some time Googling to find out where those files are. With this question, I can hopefully come to the answer right away. The question, as the title says, is: Assuming I've installed Visual Studio or the SDK, where in the file directory structure on a windows machine can I find the basic windows header files, like windows.h and winuser.h?
First you need to install Visual Studio or the Windows SDK. I'd give URLs here but they change with every new version of windows. The header files could be in
C:\Program Files\Microsoft SDKs\Windows\vX.X\Include
C:\Program Files (x86)\Microsoft SDKs\Windows\vX.X\Include
(where vX.X reflects the version number)
Update - May 2020
I'm on a new machine and installed VS2019 and the WindowsSDK and here are the new locations:
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Professional\SDK\ScopeCppSDK\vc15\SDK\include\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um
I do not see any includes in the 'Program Files' folders.

Visual Studio Team Services build process cannot find CSharp targets file

I'm trying to set up a build process in Visual Studio Team Services, and I've done so by following the steps for UWP projects using an agent on my box, but I keep getting the following build errors:
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets(7,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\10.0.10240.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I checked out the path the build is complaining about and the problem is in the 10.0.10240.0 in the path:
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\10.0.10240.0\Microsoft.Windows.UI.Xaml.CSharp.targets
The target file is located in
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets
Here is how the declaration in the project file looks like (I don't think it is erroneous and I don't see where this weird 10.0.10240.0 version comes from in the path):
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
Any suggestions on what could be wrong and how can I fix that?
The Universal Windows Platform was introduced in Windows 10. Visual Studio has support for UWP apps as of Visual Studio 2015. You need to use VS2015 to create a UWP project, and install VS2015 on your build agent machine.

Resources