devenv command line does not show error for defective projects - visual-studio-2010

We use Jenkins to build our solutions automatically. We call devenv (Visual Studio 2010) by a command line: devenv PathToProject\Project.sln /build Release
When the solution contains a defective project (*.vdproj, *.csproj), opening the solution in the Visual Studio IDE will result in an error message. But when building the solution with the above command line, no error message is shown at all, and consequently Jenkins reports success.
if you want to reproduce the problem, just open the vdproj file in an editor, and remove a } somewhere in the file.
How can that problem be solved?

On Visual Studio 2012, /Out writes the build messages to a text file.
devenv.exe YourVisualStudioSolution.sln /build "Debug|Win32" /Out "YourLogFile.txt"
According to MSDN, this switch should work on Visual Studio 2010 as well.

Related

command line solution build using devenv rebuilding more projects than visual studio solution build

I am trying to mimic visual studio solution build from command prompt using batch script but there is significant difference between manual solution build(ctrl+shift+b) inside visual studio and command line solution build using devenv in terms of project rebuild counts. More projects are getting rebuilt from command line in comparison to visual studio solution build.
I am using this for command line build in batch file:
call"C:\ProgramFiles(x86)\MicrosoftVisualStudio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
devenv solution_name.sln /build "Debug"
command line solution build output looks like this: devenv solution build using cmd prompt
visual studio solution build output looks like this: manual vs solution build output
I have tried changing the configurations too but it didn't help, I am curious why this might be happening and is there a way to get same result from command line build as of manual vs solution build?

Visual Studio Exe App compilation path change

I just want to change the exe file Visual Studio compilation path change
I am doing it like this now. i created a bat file that copied file. I have added visual studio build events. I wonder if there is an easier way.
meanwhile the exe file is being copied to the network drive
I had this problem in a different context (Elixir/Phoenix, Rust), but the root cause was the same: cl.exe could not be found during compilation.
My setup was:
Windows 10, x64
Visual Studio Community 2017 already installed, but only for C# development
For some reason the solution with installing the Visual C++ Build Tools (as #cozzamara suggested) did not work. Stops during installation with some obscure error message. Guess it did not liked my existing Visual Studio installation.
This is how I solved it:
Start up the Visual Studio Installer
Check the Desktop development with C++ (screenshots here)
Execute following command before compiling:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
From this on the command cl.exe works. Alternatively (and more conveniently for development) start the application 'Developer Command Prompt for VS 2017' or 'x64 Native Tools Command Prompt VS 2017'.
Share
I solved the problem by writing code like this in the Post build field, I just ensured that the exe was copied to the field I wanted
COPY $(TargetPath) "\x.x.x.x\ortak\yakup\TestApp.exe"
pause
$(TargetPath) = It gives the location where the exe exited, along with the exe name
"C:\yakup\project\TestApp.exe" like

How to compile visual suidop 2019 c# solution from command line w/o opening the IDE on windows?

I want to just build, and output the logs.
Following the doc,
The following command-line switches don't display the IDE.
start "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\devenv.exe" "C:\code\EPMD\Kodex\Solutions\Kodex.All.sln" /Rebuild
This does open the IDE.
Using
start "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" "C:\code\EPMD\Kodex\Solutions\Kodex.All.sln" /t:Rebuild /p:Configuration=Release
also opens the IDE and builds the solution.
Doing
start "" /WAIT "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" /build Release Kodex.All.sln
doesn't compile anything (that I know of), and returns immediately, silently.
Obviously I am missing some space or options or other trivial detail.
Don't even know how to debug this.
Help please
You can use the examples provided in the below Microsoft Docs link:
https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-build-specific-targets-in-solutions-by-using-msbuild-exe?view=vs-2019
Check the See Also section documentation as well. Hope this one helps!

Creating a build for Visual Studio Deployment Project via command prompt

I am having issues with trying to create a Visual Studio Deployment Project via command prompt.
I have a visual studio 2015 installer I am trying to create, I am running the following command:
devenv.exe <SolutionName>.sln /Build "Release|Any CPU" /Project "<InstallerProjectName>.vbproj" /ProjectConfig "Release|Any CPU"
I also read that maybe the dependent projects need to be built as well, so I have also tried that as follows:
devenv.exe <SolutionName>.sln /Build "Release|Any CPU" /Project "<ProjectName>.vbproj" /ProjectConfig "Release|Any CPU" /Project "<InstallerProjectName>.vbproj" /ProjectConfig "Release|Any CPU"
No matter what I have tried the installer project does not build and it gives an error (pop's up the Microsoft visual studio helper window)
If I run the code without the installer such as the follow that project will be built just fine.
devenv.exe <SolutionName>.sln /Build "Release|Any CPU" /Project "<ProjectName>.vbproj" /ProjectConfig "Release|Any CPU"
What I am missing to get the installer project to build?
clarity:
- for devenv.exe I am pointing straight to the devenv.exe for VS 2015, I do have multiple versions of VS installed
- I am using "" around the locations paths to deal with the spaces in the names
- language is VB.Net
Suggestions that help to locate the cause of issue and then resolve it.
1.Try using devenv.com instead of devenv.exe, so that you can quickly get output info.
See this: Using devenv.exe directly prevents output from appearing on the console.
2.For installer project, it doesn't have platform like Any Cpu. See this:
For Release|Any Cpu solution configuration, the installer project(Setup1) doesn't have Any CPU project platform by default. Which mean your /ProjectConfig "Release|Any CPU" is not valid. I think it can build if you changes it to be /ProjectConfig Release
3.And make sure your path is all right. For me, I opened Developer Command Prompt for VS2015 and then navigate to solution folder by cd C:/solutionPath. Then i use command like this to build the installer project:
Normally the project file is in SolutionPath/ProjectName(one folder)/projectName.vdproj, so I use InstallerProjectName\InstallerProjectName.vdproj instead of InstallerProjectName.vdproj. (You may need to correct the InstallerProjectName.vbproj to InstallerProjectName.vdproj in your question...)
And now the devenv command will actually try to build the installer project. And if you meet HRESULT='8000000A', it's known issue about installer project. Check my another issue for more details to resolve that. (For VS2015, you should use corresponding way of VS2015)
Hope it helps:)

DevEnv to build BizTalk Visual Studio 2013 solution from command line

I'm running the following:
D:\GitRecompile>"c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" MyFolder\MyApp.sln /build "Debug"
It gives no error, no results, nothing. Almost like I just hit enter from the command line.
I'm trying to do a batch rebuild of several BizTalk Projects from the command line to make sure all code was checked-in corretly.
I also tried:
D:\GitRecompile>c:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild MyFolder\MyApp.sln /p:Configuration=Debug
It ran, but got a lot of errors, such as xxx.xsd.cs could not be found. BizTalk creates the .cs from the .xsd at build time; so it seems like the build should have created those files.

Resources