missing UnitTestFramework in visualstudio2017 - visual-studio

I updated VisualStudio from 2015 to 2017.
When i try to launch UWP unit tests, it seems that Microsoft.VisualStudio.TestPlatform.UnitTestFramework does not exists (it gives me an error).
I tried with Microsoft.VisualStudio.TestTools.UnitTesting and project builds and run but it does not execute my tests.
How can I fix it?
Thanks

#scriptfx: What version of VS 2017 are you on? Would be great if we can see what error you are hitting. The sdk MSTestFramework.Universal should be pointing to a 15.0 version in the build logs.
On a side note you could also upgrade to the new default framework in VS 2017 - MSTest V2. More details here: https://blogs.msdn.microsoft.com/devops/2016/06/17/taking-the-mstest-framework-forward-with-mstest-v2/

I resolved it with a complete reinstall of visualstudio.

Related

MSBuild throws error of DeploymentModel for SSIS project

I'm trying to build VS (version 2019) SSIS project with MSbuild in CMD, but gets error:
The element DeploymentModel beneath element Project is unrecognized.
It worked only after I used this WA from 2017:
https://github.com/dotnet/msbuild/issues/2064#issuecomment-315875143
I was wondering if there is already solution for it or this is just the way it works?
another answer which might be relevant:
https://stackoverflow.com/a/46275125/14976099
I'm asking again as when using devenv you need Visual Studio installed on your computer, and for MSBuild you only need to have the .NET framework installed (which is where I'm hoping to get)
Per my understating, the answer is here and was released few months ago:
https://developercommunity.visualstudio.com/t/support-ssis-ssrs-ssas-in-msbuild/523612#T-N1246482

Tools Version Using Visual Studio 2017 with TFS Build 2015

I'm getting ready to start building our new release with Visual Studio 2017. I have not moved to vNext, still XAML, but plan to move forward soon when the dust settles.
At one time I thought I would be using VS 2015 and 2017 on the same machine so I had asked a question on how to differentiate or tell TFS Build which VS version to use. I was told to add these MSBuild params to the Build Definition...
/tv:15.0 /p:VisualStudioVersion=15.0
It turns out the machine will be solely using VS 2017, but I left those parameters in the Build Definition.
When I ran the build, I received this error...
MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version
"15.0" is unrecognized. Available tools versions are "4.0". Switch:
15.0
So, I removed the /tv parameter and the error went away. So, my question is, without the parameter, what tools are being used? Is the toolset TFS or Visual Studio related? Is the v15.0 toolset, if it even exists, a separate installation?
Here is the link to my original discussion on this, but I haven't been able to put it into practice until now...
TFS 2015 XAML Builds with Visual Studio
Any information, help is appreciated!! I just want to better understand what is going on for future server builds.
So, after the first response, here is additional information. From the failed build's diagnostic log, I see this...
MSBuild auto-detection: using msbuild version '15.7.179.6572' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
You can able to download the MSBuild 15.0 package alone here
This error will occur in 2 scenarios
MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version
"15.0" is unrecognized. Available tools versions are "4.0". Switch:
15.0
When you don't have installed msbuild 15.0 in your TFS Server
Your TFS Agent pointing wrong MSBuild Version ( see below image pointing towards msbuild version 15.0 )
Solution
For the 1st case, you can download the msbuild package
For the 2nd one, you can define your own Environment Variable to point towards the msbuild 15.0 version.
There is a similar question on MSDN see the solution, though might help.

VS 2013 does not see angular typescript typings

Visual Studio cannot resolve interface ng.IScope (and others from ng module).
I have added reference to angular.d.ts but it doesn't help.
What's interesting a rectangular typings are working fine - even without adding the reference.
I am using Visual Studio 2013 Update 4 with TypeScript 1.4. Anyone can help? I tried everything.
I am using visual studio 2013 update 4 with TypeScript 1.4. Anyone can help? I tried everything :/
Suspect its just an issue of an old version lingering around. Try where tsc and make sure you only see C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\.
I have added reference to angular.d.ts but it doesn't help. What's interesting a restangular typings are working fine - even without adding the reference.
Make sure you have it added to the visual studio project.
Any luck ?
I have the same problem, however, if you use the older version
angularjs.TypeScript.DefinitelyTyped version=0.9.6
(Nuget -> Install-Package angularjs.TypeScript.DefinitelyTyped -Version 0.9.6)
everything works fine and it understands the ng.IScope definition.
I don't see any structural difference between 3.1.3 and 0.9.6, so I don't understand why the older version works.

An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object

We are using Visual Studio 2012 and Team Foundation Server 2010 in our project. Since, we are using Microsoft Fakes, we could have not used the started Test functionality of our Team Build 2010, I have created a build activity which invokes VSTest.Console.exe passing the test assemblies. This approach has been working well for us. However, after a recent check-in we are getting the following error when executing Vstest.console.exe
Error: An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object.
I copied the binary files to my local machine and was able to get the error again. Interestingly, we run a dev build before check-in which runs the same vstest.console.exe with the same parameters and that works correctly. I have got two folders on my machine, for one the call works fine and for other it doesn't. The compiled assemblies look same size and there aren't much differences to suggest.
I tried using Process Monitor but couldn't find anything obvious other than that the process returns with an exit code 1. Does anybody know much about this error? Is there any way I can find out more information from my test run?
Regards,
Hamid
We got to the bottom of the problem. We are using Entity Framework 5.0 and we also have a situation where some of our test assemblies are targeting .Net 4.0 and some are targeting .Net 4.5.
When we are trying to run the tests such that assemblies targeting different versions of .Net framework and using Entity Framework 5.0 are run in the same Test (vstest.console.exe) process, we get this error.
I think this has to do with the way Entity Framework 5.0 ships with two versions (net40 and net45). Once one version of the library is loaded in the process, the other version cannot be loaded and this caused the error.
I had the same error message just now with Visual Studio 2017 using the new MSTest.Framework and MSTest.TestAdapter (to be able to use Live Unit Testing). It turned out I was using multiple versions of those packages in my solution. Consolidating them to the latest version solved the problem.
This is what worked for me:
In Visual Studio, Test -> Test Settings -> Default Processor Architecture -> X64.
Though it might not solve everyone's issue, hope it helps some of you out there.
I have the same error specified in the subject when in the AssemblyInfo of the project is specified the AssemblyAttribute:
[assembly: AssemblyCulture("en")]
If this attribute is present, the run of the unit tests fails.
If I remove this line of code or I remove the en language, the run of the unit tests success.
An exception occurred while invoking executor 'executor://mstestadapter/v2'
I had multiple TestAdapter's and TestFramework's in my BuildAgents Folder, deleting the v1.1.11 versions fixed the issue:
This happened to me recently in VS 2019. Using NuGet to update to the latest versions of MSTest.TestAdapter and MSTest.TestFramework solved the problem for me.
I tried everything on the web to solve this exception. Finally I solved this issue by installing the Update v4 of Visual Studio 2013 (which is that I'm using currently). Hope it helps!
Deleting app.config and packages.config, if exists, and reinstalling Entity framework via nuGet packages works for me.

Logging VS2010 unit test results in TFS 2008 not working

The tests appear to run fine after compliation, but the results don't go anywhere. A .trx file is written and indicates all tests passing. Team Build thinks no tests have been executed and gives the dreaded "Partial Success" result. I suspect that TFS cannot publish the trx to the database for some reason...possibly because the VS2010 version of the test results is not backwards compatible with TFS 2008...?
I'm running the build with MSBUILD 4.0 and using version 10 of MSTEST.
I've read that using the previous version of MSTEST (version 9 with VS 2008) could help. I tried this...MSTEST rightly complained that the test assembly was built against a more recent version of the .NET framework.
Anyone else had success with this? What should I try next?
Turns out I didn't have the right Microsoft.TeamSystem assemblies in the GAC. The version 9 assemblies were there but not version 10. This likely is due to VS2010 being uninstalled / reinstalled out of order w/ VS2008 (or something, who knows). A "Repair Installation" setup step solved the problem.
So, it looks like MSTEST 10 can indeed post results to a TFS 2008 datastore. Wee!

Resources