Devenv Command Line Error Level
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn devenv command line no output more about Stack Overflow the company Business Learn more about hiring developers or posting devenv command line rebuild ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community devenv command line verbose output Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Devenv command line switches error up vote 0 down vote devenv command line output to console favorite I have a simple solution which contains next to class projects also setup projects (extension installed in VS: vdproj). Facing strange behaviour doing the following: Open solution in VS2013 -> kick off rebuild -> no errors. Create a small batch file: CALL "%VS120COMNTOOLS%vsvars32.bat" DEVENV "D:\Source\Solution.sln" /Rebuild "Debug|Any CPU" 1>NUL 2>&1 IF ERRORLEVEL 1 GOTO Error IF ERRORLEVEL 0 GOTO Yeah :Error COLOR c Echo. Echo end %date%
Devenv Command Line Options
- %time% Echo Failed! PAUSE :Yeah Echo. PAUSE Run this batch file and the errorlevel is not zero Changed now inside the batch file the devenv action to the following: DEVENV "D:\Source\Solution.sln" /Clean "Debug|Any CPU" 1>NUL 2>&1 DEVENV "D:\Source\Solution.sln" /Build "Debug|Any CPU" 1>NUL 2>&1 Run this batch file and the errorlevel is zero The strange thing is that without output redirection I do also not get any errors while running the batch with the rebuild action active. Any suggestions why I do get a different behaviour? batch-file visual-studio-2013 devenv share|improve this question edited Feb 20 '15 at 12:49 asked Feb 20 '15 at 11:49 Dimi Toulakis 3,67121836 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote In the first case you are doing a Rebuild. In the second case you are doing a Clean and Build. Temporarily remove the 1>NUL 2>&1 and you should be able to see what the error is all about. You might simplify things a bit and save the results like this. Then you can view the log file before you 'Press any key to continue' if you want. CALL "%VS120COMNTOOLS%vsvars32.bat" SET "LogFile=%Temp%\BuildLog.txt" IF EXIST "%LogFile%" DEL /F /Q "%LogFile%" DEVENV "D:\Source\Solution.sln" /Rebuild "Deb
Windows Desktop Development > Visual C++ Question 0 Sign in to vote Hi, I know with the /Out option I can log what devenv.com does when trying to build the solution. However, I'd like to know if there is a way that I can capture a return value that it might
Devenv Build Command Line
set. For example: I call devenv.com from the command line with the solution file and a log file devenv options specified.One or moreof the projects fail to buildSome variable, either the return value of the devenv.com or maybe an environment variable gets set so that I know devenv download whether or not to bother inspecting the log file. If this variable says no problems, I start using the .exe. If it says problems, instead of looking for .exe I look at the log and try to find what didn't build. Is there a variable http://stackoverflow.com/questions/28628275/devenv-command-line-switches-error that would tell me this? Like, can I say, maybe in a bat file, x = devenv.com ...., and then look at the value of x? Wednesday, June 20, 2012 10:02 PM Reply | Quote Answers 0 Sign in to vote At least for Visual Studio 2008, devenv does set the errorlevel to nonzero when any project in the solution fails to compile. I have just confirmed this. To answer your final question, you can always redirect the output to a file and write a little program to parse https://social.msdn.microsoft.com/Forums/vstudio/en-US/367883f5-943a-4868-94e6-7fdfbacc7129/return-value-set-by-devenvcom?forum=vcgeneral the that file for success. Another alternative might be devenv
MPP, images formats and many more! Using Devenv at the command prompt to build projects Posted by raymondlewallen on July 20, 2005 http://codebetter.com/raymondlewallen/2005/07/20/using-devenv-at-the-command-prompt-to-build-projects/ We all know about NAnt, MsBuild and some other build tools. People are very aware of these, but seem to be unaware that you can create your own build batch file just by using visual studio and the command prompt. Let’s say you have 2 solutions, a solution with business objects and business rules assemblies, and another solution just for command line an Asp.Net GUI project. We can easily build a batch file to compile these three projects:
Batch file build REM Builds projects in debug mode REM Build data project Devenv /build debug /project DataAccess "C:\Projects\WebApplication\BusinessProjects.sln" REM Build business rules project Devenv /build debug /project BusinessRules "C:\Projects\WebApplication\BusinessProjects.sln" REM Build web application Devenv /build debug /project WebApplication "C:\Inetpub\wwwroot\WebApplication\AspWebApplication.sln" Voila! devenv command line Run the batch file to build everything in debug build. “Devenv” is the IDE executable. /build is the switch to build the project. It takes either “debug” or “release” as arguments. Change “debug” to “release” to build everything in release mode. /project and its argument specifiy the name of the project to build within a solution. The final argument for “devenv” is the location of the solution file that contains the project you want to build. Note: This works for .Net IDE 2002 and 2003. I have not tried this with 2005 yet. If anyone has, let me know of the changes in the comments below. You can do “devenv /?” at the command prompt to list all available switches for Devenv, with descriptions of their uses. From MSDN Documentation: The following syntax rules apply to all switches and arguments: The command line syntax must start with devenv. For example, to use the /fn switch you would type the following: devenv /fn arial Switches are not case sensitive. The first argument is typically a solution file name