MSBuild always build all platforms even when specific one provided - msbuild

Any ideas as to why MSBuild is always building all my platforms for my UWP solution even though I'm specifying to only build for the ARM platform. This is the command line I'm using:
MSBuild.exe C:\MyApp\MyApp.sln /p:Configuration=Release /p:Platform=ARM
Am I missing something or doing something wrong?
Thanks.
UPDATE - 1:
I've also tried specifying x86 as the platform, but it still builds all platforms.

After spending hours trying to figure out this problem, I have eventually figured out what's wrong, well partially at least!
As mentioned, the above does not work as expected, unless I first create a package via the .NET IDE and only select a single platform. Once I do this, the above command line will build the relevant platform that's specified in the command line!
I've just tried it again and created a package via the .NET IDE and re-selected all platforms and called my original command line once again, and it build all platforms rather than the one specified in the command line. There is obviously something in the solution file that's causing this but personally I think this behaviour is wrong and is a bug.
The following command lines seem to worked irrelevant of what has been selected via the .NET IDE:
To only build a package for ARM in Release mode:
msbuild "c:\myapp\myapp.sln" /p:configuration=release;platform=ARM;
AppxBundle=Always;AppxBundlePlatforms="ARM"
To only build a package for x86 in Debug mode:
msbuild "c:\myapp\myapp.sln" /p:configuration=debug;platform=x86;
AppxBundle=Always;AppxBundlePlatforms="x86"
While the above works, irrelevant of what's selected in the .NET IDE, I haven't figured out how to build all platforms.
I'll also investigate the original command line problem and the link with via the .NET IDE selection, and I'll update my answer if I find out what's causing it.
Hope this helps.

Related

Fail build on static code analysis warnings with msbuild and bamboo

Using bamboo v5.7 with msbuild v12, how do I fail a build if there are any static code analysis warnings? We do have our projects all set to treat all warnings as errors so the project itself doesn't build, but bamboo is not detecting this and continues on.
This seems basic, what might I be doing wrong?
The simple answer is you are doing nothing wrong, nor are you missing anything.
While it seems like basic functionality, Bamboo's MSBuild task currently doesn't support reading, reporting or failing the build on Warnings or Errors. The task only fails because MSBuild (or XBuild if you are using Mono) returns with an error code when a compiler error occurs.
Also, MSBuild doesn't actually support failing on all warnings either, as you can see here.
You have a couple options.
You can use one of the options in the referenced post
You could roll your own MSBuild log parser plugin using Atlassian's Plugin SDK.
You could make a simple script that is executed after the build, reads the logs and returns a non-zero integer if there were compiler warnings.
You can vote for the issue in the Atlassian Jira and also for the related issue for parsing build details.
Whatever your solution, I hope you share it with the many of us that have run into the same problem. It seems to be something quite common, so I was surprised there wasn't an issue already open for this in Atlassian's Jira instance
For VS 2008 and later, a new project setting was added for this. See this link.

qtcreator cmake "No executable specified"

Im having a very annoying issue with qtcreator and cmake projects: qtcreator fails to find the executable. It just prints "No executable specified" when trying to launch any executable from the IDE. Everything works fine after configuring the project (first time only). The issue manifests when loading the project afterwards. Only workaround is deleting the "CMakeLists.txt.user" before every use. This is tedious and unnecessary.
This is happening to projects that were running just fine for years, both my own and my colleagues, on multiple machines running ubuntu 14.04 & 14.10. Problems started with qtcreator version 3 and higher from ubuntu 14.04 upwards.
Assuming that the issue is triggered by some changes in the "CMakeLists.txt.user", after the project is closed the first time, I replaced the file with a copy of it right after it was created the first time. This worked, thus confirming that there is either something wrong with the file itself, or changes to it trigger an existing bug in qt-creator. Unfortunately it is just as tedious as deleting the file in the first place.
My Challenge:
Unfortunately I am not familiar with the inner workings of qtcreaor, however I managed to identify the specific config lines that are responsible. What does qtcreator actually change here?
Please note that "racoon" is the project name and the above diff screenshot is much larger than formatted by stackoverflow (right-click to view full resolution).
Thank you.
i had exactly the same problem using Ubuntu 14.10 and resolved it by doing the following:
Get ftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/a/an/anthonos/mirror/os3-next/os3-rpm/q/qtcreator-3.1.2-0.x86_64.rpm
Extract the file /usr/lib/qtcreator/plugins/QtProject/libCMakeProjectManager.so
Overwrite this file at
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/ ( at least on x64)
in your system
This will replace the cmake plugin which is currently version 3.1.1 with 3.1.2 which will make the problem disappear !
I installed qtcreator using Qt's own installer instead of the one provided by Ubuntu. It installs version 5.3.1 and fixes the problem.

Including Missing DLLs

I am developing in DX 10/11, & when I tried the code on another computer with a NV 660, it said that d3dx11d_43 was not found. I reinstalled the Visual C++ 2012 32/64 bit & DirectX Runtime, but still says that. I think that the user needs to install the SDK or something.
I get the warning that the debug info cant be found.
From what I have reading, it is because I have something that depends on something debug related. No idea what though.
Is there a way to make the game compile with most, if not all, of the DLLs? I dont mind the extra size. The content of many games out-weigh the extra DLLs that are used.
I did compile as Release.
Edit:
Removed 1st question, since no one answered it.
You can add the dlls you need to the resource file, then compile the resource file to your exe file, and at last, parse the resource file at run time to get the dlls you need. here is a similar question, you can take a look.
d3dx11d_43 is a debug version of d3dx11_43 which your program links with when you do a debug build rather than a release build. The debug version is not included in the directx runtime installer, only in the SDK.
The license does not allow you to distribute it either.
You should build and distribute release versions of the code, or else require users to install the SDK which probably wouldn't be so popular!

clang Can't find any frameworks

I've been tearing my hair out over this, and Google hasn't yielded much so my problem must be caused by my own specific brand of stupidity.
Basically, having installed Xcode 4 I removed the /Developer-old folder (properly, can't remember the command but I used the uninstall script rather than sticking it in the trash).
Xcode builds projects fine, and the latest version of all the Objective-C frameworks seem to live in /System/Library/Frameworks, but when I compile something (which built fine in the Xcode 3 days) clang complains that it can't find any headers, e.g:
fatal error: 'Cocoa/Cocoa.h' file not found
I've tried forcing the framework search path with -F to no avail- is there a common underlying issue or have I just screwed my machine?
Reinstall the developer tools. It will take a lot less time than tracking down whatever you broke.

VB.NET - Application has encountered a user-defined breakpoint

I'm not that up on VB.NET, the application I'm working on was not written by myself.
It works fine through the IDE but once I run it from the exe it gives me the above error.
Any clues?
This is really hacking me off!
The only user defined break point that I can think of is
Debugger.Break()
So, I would suspect that the .exe is compiled in debug mode. I would recommend Reflector to look at the code and find out for sure whether or not there is a Debugger.Break() somewhere in there.
Afaik, the only way this could occur if you are compiling under debugging settings. You should be able to fix it by doing the following:
Right-click your solution on the
solution explorer.
Select configuration properties.
At the top of the dialog box there should be a
combobox, which will most likely say
"Active(Debug)".
Click on the dropdown and select release.
Ok out of everything.
Build > Rebuild Solution.
Source: p2p.wrox.com
I believe the exe file was compiled using the "Debug" setting. Try changing the Build setting to Release and do a full build (rebuild) of the project. Then try to run the executable file. It should then run normally.
The reason you see that error is because when you normally compile and run applications in Visual Studio, it compiles a Debug build of the executable. The different between a debug build and a release build is that the debug build has additional information added to it, by the compiler, so it can be debugged properly.
I would suggest looking for stop in your code. That is what generated this error for me.