Visual Studio 2013 has a problem when building, it displays an error message as follows:
c:>devenv /build debug /project (project name) /projectconfig "debug|x64" (solution Name).sln
1>This operation should only take place on the UI thread.
The vcvarsall.bat file has additional information about specific version numbers. To build a C/C++ project at a command prompt, Visual Studio provides these command-line tools: Use the compiler (cl.exe) to compile and link source code files into apps, libraries, and DLLs.
For example, the target for the x64 Native Tools Command Prompt for VS 2017 shortcut is something similar to: %comspec% /k "C:Program Files (x86)Microsoft Visual Studio2017CommunityVCAuxiliaryBuildvcvars64.bat". Open the Properties dialog for a developer command prompt shortcut to see the command target used.
Starting in Visual Studio 2019 version 16.5, MSBuild and DEVENV don't use the command-line environment to control the toolset and libraries used. These articles show how to build apps on the command line, and describe how to customize the command-line build environment.
MSBuild runs in containerized build environments, and supports a binary logger. Use DEVENV (devenv.exe) combined with a command-line switch such as /Build or /Clean to execute certain build commands without displaying the Visual Studio IDE.
I just ran into this with Visual Studio 2015 compiling C++ code (error: This operation should only take place on the UI thread). Finally traced it to the .vcxproj.filters file for the project that was failing to compile. This file had been merged from another code stream and was missing a closing "ClCompile" XML tag in one spot. Apparently this leads to the error, although compiling in the IDE worked fine.
There is a workaround : use
msbuild /p:Configuration=Debug;Platform=x64 (solution Name).sln..
moreover I have no issues using devenv /build once I have used msbuild.
Black magic !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With