I am using Visual studio test task to run all my tests as a part of my build definition.
The options that I have enabled are as attached below:
Now, the problem here is that, some of my tests always fail when I run them from the build pipleine , however all of these test seem to pass when I run them via
vstests console.exe command.
ex: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\VSTest.Console" <path to dll>
Does anyone have any clue what could be wrong in here?
Thanks.
Using the Installed by tools installer selection, I would need to see what your tools installation task is doing to provide additional info. Maybe you're not installing a version that is compatible with the tests?
If you don't have a specific need to call out a different test platform version, maybe try using Latest.
OR
Since you're calling ...\Microsoft Visual Studio 14.0\...\VSTest.Console, you may want to select the Visual Studio 2015 option.
Related
Currenlty I am using Visual Studio community edition and Gtest.
When I run my test using the Visual Studio debug, my test are running fine
But when I build the solution and run my test fail.
Is there a way I can pass the PATH environment to the command I am runnig?
Try to set the PATH on powershell so it would load while running the command.
Thanks to #273k I was able to solve my problem.
The reason this test did not pass on the command line, was due to this was being run on a different folder.
Once I moved the relevant support files in the same folder the test started to pass
Recently I upgraded a project to Visual Studio 2022. I am using command line to build the installer project (.vdproj) using the command something shown below
devenv.com <Solutionfile> /build <InstallerConfiguration>.
The command used to build file with VS 2019 but when trying to build the same with Visual Studio 2022 seems to be stuck. It seems that everything builds fine but the Visual Studio process does not exit after the project is built and causes the build pipeline to be stalled. I have disabled out of proc build to see if this was causing the issue but it does not help. Any one experience the same issue? I am using the most recent version of visual studio along with the Visual Studio installer project extension. Any other method of building the installer project? I have tried MSBuild command but it does not understand vdproj files.
This has been fixed with the latest release of VS 2022 17.3.6. Works fine for me now.
I have a project using the SpeechClient.dll from NuGet. The program runs fine on the development machine. So I have a Windows Setup Project that creates the installer. I run the installer and all the files show up including the SpeechClient.dll, but as soon as the program makes the first call to the Speechclient.dll, I get a
file not found
exception. This is the output from the event viewer.
Does anyone have any troubleshooting ideas? Thanks.
Seems now that I have installed visual studio on the machine that it is working. I wonder what visual studio installs? I was also trying to use Fusion Log Viewer to see what the problem was.
I had this problem as well. Installing the Visual Studio C++ Redistributable 2017 x64 cleared it up.
Is there a way to make the VS Package Manager commands available on Powershell Console? I looked over this link but I was unable to understand the NuGet philosophy.
I know that I can access it in Visual Studio but, let me explain my approach and goal.
I want to learn F# and for this use a lot its REPL. So basicaly, I open a Powershell console, change to my working folder, create a file with some code, fire the REPL, try various things.
In this kind of loop makes sense to have means to install various packages without starting VS and having to create a VS project.
Thanks!
Please refer to below screenshots:
The problem is that the PowerShell cmdlets that NuGet makes available inside Visual Studio rely heavily on Visual Studio so they are not supported outside of Visual Studio from the command line.
From the command line you have NuGet.exe which supports the following which are project related:
Downloading NuGet packages. Basically restoring the missing NuGet packages as defined in a packages.config file. NuGet.exe install or NuGet.exe restore
Updating a NuGet package in a project. This will update the reference information but not run PowerShell scripts. NuGet update
Having the NuGet PowerShell cmdlets available on the command line is something I have looked at doing using the cmdlets that SharpDevelop provides. It is possible to fully support NuGet install/update/uninstall and have the PowerShell scripts execute on the project but in this case it requires an entire IDE, in this case SharpDevelop, to be available, at least its assemblies, even though the IDE is not run. This is needed to support updating the project file using the Visual Studio project model (EnvDTE) from within any PowerShell scripts that run.
Nuget commands cannot be used outside of Visual Studio. However, if you were change to use Paket instead of Nuget, then you can use Paket from a command line outside of Visual Studio to manage your project's packages.
The getting started page is here.
I started down this path of wanting to do code analysis on my solution using msbuild. I was looking at FxCop but it appears to now be part of Visual Studio and from my understanding you need Visual Studio installed on your build agents.
I am calling msbuild from a powershell using the following command;
"$(get-content env:systemroot)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /tv:4.0 /p:RunCodeAnalysis=Always"
It appears to run the code analysis and output warnings but never fails the build, even after I added <CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
to my .csproj file.
All I want is to run code analysis from msbuild command line and have it fail the build if any warning is found. I understand it can be done in Visual Studio but I need to be able to run this from the command line (with/without VS2013)
Am I missing something? Shouldn't /p:RunCodeAnalysis=Always and setting the CodeAnalysisTreatWarningsAsErrors to true be all that is needed?