My Windows app has 2 build configurations - x86 & x64.
I have 2 setup projects - one targeting the x86 build to produce a 32-bit MSI, and one targeting the x64 build to produce a 64-bit MSI.
In each setup project, I have added the project output for the specific configuration, e.g. Release | x86 for the x86 Setup Project. This pulls in the detected dependencies (other projects in the solution).
Problem: When I build my project and then look at the source path property of my dependencies, they default to the x86 versions, even if the x64 project output was added as primary output. For example, in my x64 Setup Project, if I build the x86 version in VS, then my x64 setup project dependencies will be pulled from the bin\x86 folder and not the bin\x64 folder.
Ideally I would like the dependencies to remain consistent with the type of Primary Output selected i.e. if my primary output is added from the x86 build, then I want all my dependencies referenced from the bin\x86 folder. If my primary output is added from the x64 build, then I want all my dependencies referenced from the bin\x64 folder.
I am curious to know if there is a way where I can stop the detected dependencies from auto-updating to match the last build configuration in Visual Studio.
Related
We have a build script which uses MSBuild to build our solution. It has worked fine for VS2013, but it has broken since we installed VS2015 and upgraded. Initially, it failed with this error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for v140
(Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools. Alternatively, yo
u may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgra
de Solution...". [C:\Users\user\Documents\GitHub[snipped]Api.vcxproj]
So it was failing to build a C++ project since is seemed to default to using version 12 of MSBuild, even though it was a VS2015 project. So I added:
/tv:14.0
To the invocation of MSBuild to force it to use the right tools version. Now it fails with this:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(219,5): error MSB4175: The ta
sk factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v12
.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v12.0.dll' or one of
its dependencies. The system cannot find the file specified. [C:\Users\user\Documents\GitHub[snip].Api.vcxproj]
Now it's looking for a v12 assembly in the v14 folder. How do I fix this? I can't see any obvious place to make this change.
Note: The C++ project itself might be a red herring, the solution is mostly C# and this might just be the place where it loads in the tasks.
It seems like something is wrong in the "Select and configure packages". I can execute and build x86 and x64 packages normally, but when I go to "create package" to upload it to the windows store, x86 option appears with "mixed platform" configuration only, no x86. And in the x64 architecture the x86 configuration is selected by default,I changed it to x64 but when compiling to create the package lots of errors appears.
UPDATE
I removed unnecessary build configurations, just left ARM, x64 x86.
but when building the package from the "Create package" option everything is broken again.
I have correctly compiled Boost for Windows 8 with VS-10 as given in this link. My project works fine. But when I copy the project to another Windows 7 machine it returns an error message as "The application was unable to start correctly (0xc000007b). Click OK to close this application.". I have correctly installed Boost in the second PC as well. Both PCs are 64-bit and I installed 32-bit Boost in both. As I found from some links this is because the project try dynamically linking 64-bit libraries instead 32-bit. Could you kindly advice how to build this as a portable solution. Thanks in advance.
Update 1:
Following is the dependency walker output.
Are you sure you selected the Visual Studio 2010 Command Prompt x86 to compile the library? or the x64 version? there is more than 1 version of the command prompt in the start menu. my guess would be that you accidentally ran the x64 version, and then compiled boost with it, resulting in a x64 bit version of the library compiled.
Here's a batch file that compiles the static and shared version of boost in x86:
compileboost.bat:
call "%vs110comntools%..\..\VC\vcvarsall.bat" x86
cd C:/boostsourcefolder/
call bootstrap.bat
.\b2 runtime-link=static
.\b2 runtime-link=shared
Then in your VS2010 project properties, Common Properties -> VC++ Directories -> Include Directories, type your boost folder (C:/boostsourcefolder/). and in Common Properties -> VC++ Directories -> Library Directories, type the boost compiled library folder (C:/boostsourcefolder/stage/lib/).
That's pretty much all you need to do.
I have this command in a post build event:
if $(ConfigurationName) == Release "$(SolutionDir)Tools\NuGet.exe" pack "$(ProjectDir)MyProject.Contracts.nuspec"
This works just fine when I compile in Visual Studio. But when my build runs this it fails. That is because someone somewhere thought it was a good idea to have builds on TFS not run the same as a build on a dev machine.
In this case it is the fact that all output files are grouped into a common "Binaries" folder.
So, my question is this:
Is there a property I can use (instead of ProjectDir) that will allow me to reference the output location of the build?
Meaning that it will point to the binaries folder when running a TFS build and point to my normal output when doing a normal Visual Studio based build.
I tried $(OutDir) but it equated to "bin\Release\"
UPDATE: I tried to use $(OutDir) but Visual Studio fails with the partial path it provides. Is there something that could be used with $(OutDir) to give a full path for both Visual Studio and TFS builds?
In case it matters:
TFS version is TFS 2010 (Latest releases installed)
Build Machine and Dev Machine are both running Windows 7 and VS 2010 Ulitmate
$(OutDir) should resolve to your bin\debug or bin\release etc for local builds, on the build server this will be resolved to the Binaries folder.
So yes, $(OutDir) should be the right one to use.
I have a really simple project that I am trying to build with Visual Studio 2010 Express (x64) edition (C++). It contains only 1 file (main.cpp) that is used to find the machine epsilon on my machine and does nothing else. When I try to compile a Debug x86 build everything works fine and an .exe is generated but I would like to make a release build as I need to turn this code is as a HW assignment. When I try and compile a Release (x86) build it fails with the following error -
1>LINK : fatal error LNK1296: unable to load msobj100.dll
I ran a search and the only place I found a file called msobj100.dll is in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64" so I tried adding that location to the solution's VC Directories -> Executable Directories line. It didn't work. Why does the Release build complain about this DLL when the Debug build does not? I have compared both build pages and can not seem to find any differences in their dependencies or directory locations. I would really like to know what is going on. Thanks!
You're trying to load the 64-bit DLL in your x86 application, you can probably find msobj100.dll in C:\Windows\SysWow64