DevEnv to build BizTalk Visual Studio 2013 solution from command line - visual-studio-2013

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.

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?

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!

Unit Test failed when using Visual Studio Command Prompt

I have class library project which reads word document files. and I have created 30 unit cases scenarios for it. When I run the unit test using visual studio IDE it runs perfectly and all the test cases get "Success", However when I use Visual Studio Command Prompt and test it, some of the test cases get failed. I would appreciate if you guys can provide me some hint in this regard.
To test my solution in Command Prompts I type: "MSTest /testcontainer:mysolutiontest.dll"
If you are running VS2012 or later, use vstest.console.exe:
"C:\Program Files (x86)\Microsoft Visual Studio
12.0\Common7\ide\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
PathToYour.dll /logger:trx
You'll also probably want to use a .runsettings file to specify the TargetPlatform and ResultsDirectory, which would then use a command line like this:
"C:\Program Files (x86)\Microsoft Visual Studio
12.0\Common7\ide\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
PathToYour.dll /logger:trx
/settings:PathToYour.runsettings

devenv command line does not show error for defective projects

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.

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.

Resources