devenv.exe /upgrade not working as intended - visual-studio

I am trying to use devenv.exe to upgrade Visual Studio 2013 solution files through the command line.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe" TimeReportingDataMart.sln /Upgrade
But there is no output, and the solution does not upgrade. Is devenv not the correct tool for this? Or am I just missing something completely?

The problem was that I was calling devenv.exe when I should have been calling devenv.
Calling,
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe" TimeReportingDataMart.sln /Upgrade fails.
But calling
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv" TimeReportingDataMart.sln /Upgrade gives me output.
It gives:
Copyright (C) Microsoft Corp. All rights reserved.
Information:
This project/solution does not require migration. It will open without modification.
Which doesn't help me, but at least I got the command to run..

Related

The operation could not be completed devenv /setup

I am troubleshooting why my xaf xafml files open in xml instead of the designer
and looking at the help here
Here is my console output of me trying to run devenv /setup
C:\>cd c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE>devenv /setup
Microsoft Visual Studio 2017 Version 15.0.27703.2000.
Copyright (C) Microsoft Corp. All rights reserved.
The operation could not be completed
I have solved the issue by running the console as Administrator.

Different Paths To msbuild in VS2017

OS: Microsoft Windows [Version 10.0.14393]
VS-Version: 2017 Community
When I run vswhere.exe I get the following back and based on on the official vswhere documentation I can build the path to msbuild and this seems to work:
C:\Users\user\Desktop>"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
Visual Studio Locator version 1.0.62 [query version 1.10.80.60812]
Copyright (C) Microsoft Corporation. All rights reserved.
[...]
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
[...]
C:\Users\user\Desktop>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
Microsoft (R)-Buildmodul, Version 15.1.1012.6693
If I start the developer command prompt located in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat" I get the following result:
C:\Users\user>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
**********************************************************************
** Visual Studio 2017 MSBuild Command Prompt
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
C:\Users\user>where msbuild
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
Why and what is the second path returned after starting the developer command prompt
I always use the first path ("C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe") to call msbuild for building C/C++/VC++ Projects. Is this in someway wrong?
VS 2017 switched to local copies of msbuild, if you used a VS 2015 command prompt, you would see a different global path.
The where command lists all the matching executable files that it finds on the PATH, but only the first one will be used by the command prompt when you run an msbuild command.
The second msbuild.exe you see is part of the .NET Framework - this is the version of MSBuild that was integrated into and shipped as part of the .NET Framework. This version is old compared to the ones installed by recent versions of Visual Studio. But it will likely be continued to be included in .NET Framework for compatibility reasons. It is even able to build a lot of projects that will then use the targets and tasks installed by VS - only project format changes that required changes to MSBuild itself will be incompatible (like the new project format used for .NET Core projects).
You should always use the VS 2017 version of msbuild.exe to always get build results consistent with visual studio.

How to create a Batch File for Visual Studio Command Prompt

I want to create a batch file for Visual Studio 2008 x64 Cross Tools Command Prompt to do something continuesly in my PC, here is the senario.
svn update
delete some files
MSBuild MySolutiuon.sln
delete some files
xcopy somefiles
MSBuild AutomateBuildConfiguration.xml /p:Configuration=Release
xcopy some files
delete somefiles
xcopy some files
create a Zip file if it is possible // it is not neccessary
I can do most of it with simple Command Prompt and MSBuild parts with Visual Studio Command Prompt, but as these two prompt are different I cannot complete my senario.
I have tested all command and work great for me, Give me a solution if you know what should I do.
I checked this and didn't underestand anything
Thank you in advance
Make the first line of your batch file set up the VS environment:
call "C:\Program Files\Microsoft Visual Studio 2008\VC\vcvarsall.bat" x86_amd64
svn update
delete some files
MSBuild MySolutiuon.sln
... more commands ...
x86_amd64 is the argument used for x64 Cross Tools Command Prompt.
Once vcvarsall.bat has run, msbuild will be available in the path for the rest of the commands in your batch file.
Alternatively, if you aren't using Visual C++, you might prefer to set up the environment with this line (instead of the call to vcvarsall.bat):
For VS 2008:
call "%vs90comntools%vsvars32.bat"
For VS 2010:
call "%vs100comntools%vsvars32.bat"
For VS 2012:
call "%vs110comntools%vsvars32.bat"
For VS 2013:
call "%vs120comntools%vsvars32.bat"
For VS 2015:
call "%vs140comntools%vsvars32.bat"
For VS 2017:
Batch is now called vc not vs.
call "%vs140comntools%\..\..\VC\Auxiliary\Build\vcvars32.bat"
or better
call "%vs140comntools%\VsDevCmd.bat"
For Visual Studio 2015:
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
For Visual Studio 2013:
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
For Visual Studio 2010, this is working great:
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
For Visual Studio 2019 :
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
And for Visual Studio 2012:
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64
I wrote a bat file using the following steps and it worked.
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
echo call complete
pause
cd C:\tfs.sbdinc.com
tf get $/MAC_MBA/CoreApplicationAndReports/Main/Application/Solution /recursive
echo get complete
pause
cd C:\tfs\CoreApplicationAndReports\Main\Application\Solution
msbuild
echo build complete
pause
devenv mba.sln
echo ide launch complete
pause
Try below batch file to run the MS test/Nunit test for C# tests.
#echo off
echo Run the CMD(Command Prompt) Program.
echo.
pause
cls
echo Target Framwork
CD C:\Windows\Microsoft.NET\Framework64\v4.0.30319
echo 'Project Path'
msbuild "C:\Git\ElementsCloud.Tests\Source\ElementsCloud.Tests.sln"/p:configuration=debug
pause
echo 'Project Dll path' and Execute tests
cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow
vstest.console.exe "C:\Git\ElementsCloud.Tests\Source\Selenium.Tests\bin\Debug\net471\Selenium.Tests.dll" /Tests:Test1,Test2,Test3
echo.
PAUSE
EXIT

Error Code -1073741515 When Using EDITBIN

I'm using EditBin to increase the stack size of an application I'm writing. I have this in the post-build event command line for Visual Studio:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\editbin.exe" /STACK:268435456 "$(TargetPath)"
When I build my project, I get this error:
Error 470 The command ""C:\Program
Files (x86)\Microsoft Visual Studio
10.0\VC\bin\editbin.exe" /STACK:268435456 "[Target Executable]"" exited
with code -1073741515.
I have both of the following in my PATH environment variable:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
The command also works when I run it manually with cmd.exe. Does anyone know what the problem is here?
I had the same issue, how I resolved it:
Ran msbuild.exe <my.sln> /t:<mytargetproject> from a VS2010 command prompt, where <my.sln> is your solution name and <mytargetproject> is the project you are trying to build. For e.g. msbuild.exe helloworld.sln /t:mainproj.
When you do this or at least when I ran this, a dialog box popped up and said "foo.dll" cannot be found, I added the path of that dll to my "PATH" environment variable and the problem was solved! See ChrisF's comment to the question, as it says, the error is that some dll/component is missing.
From the dll name it complained about, I believe this is not contained to VS2010 libs/dlls, for me it was a third-party dll (which I am using and supposed to be available during the build) it was complaining about.
The best solution is to run the vcvarsall.bat located in the root of the visual studio install folder(C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC). That sets up the search folders for all MSVC compiler related tools.
I got this to work for now by copying mspdb100.dll into the same directory as editbin.exe, but this is not an optimal solution because every developer on my team will need to do the same thing.

I get "operation cannot be completed" when i try to open visual studio 2010?

Hi I am getting the operation cannot be completed error when i tried to open Visual studio 2010. Previous to that I was trying to install web platform and didnt install but that is all I did...anyone have suggestions...i tried restart my pc...
Try devenv /setup, devenv /resetsettings, or devenv /resetuserdata. Important: only try the last two as a last resort since they will reset your settings.
Assuming you're on a 32-bit OS, devenv is available from the command-line at \Program Files\Microsoft Visual Studio 10.0\Common7\IDE or from the VS command prompt.

Resources