How to troubleshoot deployment issues when running tests with visual studio? - visual-studio-2010

In VisualStudio (2010 and 2012) :
is there an efficient way to troubleshoot deployment issues when using DeploymentItem attribute?
I currently must wait for test execution to realize that the items where not deployed. Also, when a path error occurs, it's painful to detect where the error stands.

All deployment errors are written in .trx file. Also items are deployed before test run in "out" folder.

Related

Team Foundation Server build failure

I have following tools installed on my machine:
TFS 2017
Visual Studio 2017
MSBuild 14.0
In my application, I'm using some C#6 elements like string interpolation ($).
When I try to build it, controller says that it could not resolve the symbol.
Builds fail for both XAML and standard definitions.
In build logs, there's an information that it uses correct MSBuild 14.0 path: C:\Program Files (x86)\MSBuild\14.0\bin, but still failes to resolve C#6 elements.
I would really appreciate if you would help me with this problem, I've searched entire internet and found nothing :/
If you guys need any information, I'll be more than happy to provide it. Thank you.
TFS with XAML build is just using MSBuild to run the build. You could first try to use MSBuild command to run the build test locally, which will narrow down the issue.
If it works well on your dev machine and not works from a TFS server build. Very likely the environment problem.
To make sure the build successful, you should keep your build server environment the same with your local environment. Please double check this.
For trouble shooting, you could try to remote to your build agent, manually run your build and test on your build agent.
As for how to enable C#6, you could also refer this similar question, modify TFSBuildServiceHost.exe.config file which may do the trick. How do I enable C# 7 builds in Team Foundation Server 2015?
If you still get error, please include detail build failed logs here.

Diagnosing why Visual Studio skips building a project

I have a large solution of dozens of projects. Since yesterday (and for no good reason that I can find) the projects are refusing to build, with Visual Studio's build output window simply stating (eg)
1>------ Skipped Rebuild All: Project: Api.Models.Common ------
There are already a few similar q/a's here about the reasons why VS may decide to skip a build (Configuration not set to build, or set to build wrong target). I'm not interested in guesses as to why this isn't building. I'd really like answers to help me diagnose this, and have Visual Studio tell me why it thinks it can skip the build.
Is there a way to have VS generate anything more detailed than Skipped rebuild for example? It must be calling msbuild under the covers right? So can I have Visual Studio pass additional parameters to msbuild so that it generates diagnostic log output?
(For what it's worth - calling msbuild from the command line builds the projects as expected, so it seems like my issue is something quirky that VS is doing).
I'm using VS 2017 - 15.9.4
If you have any unload projects, you must load it or you remove it in solution.
Note: My unloaded project was the result of a permission issue. VS warned that a project was configured to use IIS. To run the project with IIS required launching VS as an administrator.
This was happening in my solution with Visual Studio 2019. I just migrated my applications from .Net Framework 4.6 to .NET5, almost all the projects were not building, it gets always skipped. The reason was that after the migration the tool upgrade assistant was not setting the Target Framwework as in the preceding image (Right-click on the project and then click on Properties).
After setting it to the right framework, in my case, it was .NET 5.0, the project started to build.

Run Visual Studio 2013 unit test without installing visual studio on server

I'm trying to run my unit test created via Visual Studio 2013 on my staging server.
I don't want to install Visual Studio there, not the Test Agent so I found a way to run them by copying some of the DLLs and EXEs needed.
Yes, I know it is a hack but I prefer this solution instead of the Test Agent to keep the staging environment completely clean.
Anyway, the test are correctly done, except for the fact that the vstest.discoveryengine.exe crashes with the following error:
failed to initialize client proxy: could not connect to vstest.discoveryengine.exe
Note: this crash doesn't prevent the successful completion of the tests, just an annoying popup to close any time by hand...
I tried to run my batch script as Administrator but no luck.
Have you got any hint on how to prevent vstest.discoveryengine.exe from starting or listing the existent tests?
Thank you very much
Best
cghersi
I found the solution by manually copying some other DLLs in my folder.
Perhaps someone is interested in my same scenario, so I prepared the complete solution here:
http://www.snip2code.com/Snippet/59304/How-to-run-unit-tests-created-with-MS-Vi
It perfectly works for me, and my staging environment is still perfectly clean!
Let me know if it works for you guys.
Thank you

How to run Code Coverage on a nightly build with TFS 2008/Visual Studio 2010

I currently have a solution with a number of projects which include Unit Tests.
We've got a CI build and a separate Scheduled build and I would like to be able to run Code Coverage on the latter (not the CI).
At the moment we are using Visual Studio 2010 and TFS 2008. None of these can be changed.
I've looked around for hours and lots of suggestions mention a Process tab to select in the Build Definition however further investigation shows that the combination of VS/TFS that we have does not have this option.
Another source says to modify some testsettings such that they contain the Code Coverage option (which I have done) and then define the Test Settings file in the build - but I have no idea how to do this (http://www.codewrecks.com/blog/index.php/2010/06/14/running-code-coverage-in-tfs2010-builds/).
I have a testsettings configuration that will run code coverage locally so my issue is that I need the MSBuild TFSBuild.proj file to know which testsettings file to use when running it's tests (through the <RunTest>true</RunTest> option).
Any help on this would be greatly appreciated. I've trawled through the various other proposed solutions but none seem to match this. They either use a better version of TFS, or do something else.
EDIT. I suspect I might be restricted to using an Exec task within the build script and running the Vsperfmon.exe command with some arguments. If this is the case please provide an example because I've no idea how to capture the results from this command and tie them to my Scheduled build.
Thanks all.

Error VS1290: The backplane configuration file is either missing

I'm working on a layered application on VS2010 with TFS 2012, the application has some class library projects, unit tests and an mvc4 web.
This error is appearing on my error list:
VS1290: The backplane configuration file is either missing, corrupted, or not valid and must be repaired. Otherwise, integrations between designers will no longer function. Repair the Visual Studio installation and try again.
Doing some searches I found this but it's closed as not reproducible. I'll appreciate any help provided.
Note the application is working, but I'd like to resolve it anyway.
Saldy the solution for me was reinstalling Visual Studio.

Resources