QualityToolsPackage failed to load in build? - visual-studio

I am using Bamboo [from Altassian] and it uses the devenv.com builder to build solution files. Currently, I seem to be getting a "false" error in my builds - that I've tried to solve by myself but just can't - so I thought I would ask.
Each build succeeds normally - without errors stemming from code - but seems to instead give this error
Package 'Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage, Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed to load.
I've no idea why this is causing problems in the devenv.com environment and I can't figure out either how to "ignore" this error by some build command?

Try this ( from MSFT support )
Can you check if the dll is in the global assembly cache (open a VS 2010 command prompt
(Start | All Programs | Microsoft Visual Studio 10.0 | Visual Studio Tools))
Type in
Gacutil –l > list.txt
Notepad list.txt
Do you see an entry like
Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
If so, from the same command prompt, run fuslogvw, go to settings, select log bind failures to disk, select ok
Run your command line
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com /Build "Release|Mixed Platforms" "D:\Builds\19\Test VizXView\VizXView v1.8 Test Release Build - Weekly\Sources\VizXView v1.8\VizXView 1.8.sln"
Click on the refresh button in fuslogvw. Do we get any bind errors?

I had a similar issue related to running unit tests on a build server that was using devenv.exe (not devenv.com). I had a premium VS installed on the build server but I'd written the unit tests with ultimate (which 'has' load testing, even tho I'd not used it). I used fusion viewer to work out that the missing dll was LoadTest.dll which I copied from my laptop to the buildserver, I also removed references in my solution that were in version control to: *.vsmdi and *.testsettings (they're deprecated) and I removed from the build def a reference to a .testsettings file.
My guess would be that even though I wasn't running a load unit test the build agent was trying to load the LoadTest libs just in case. Hope that helps
edit ---
ok, my own problem here was that I've got both vs2010 and vs2013 on my laptop. When I added the first test project to my VS2010 solution, the project added actually has a dependency on the 2013 version of the UnitTestFramework.dll. My build server only has vs2010 on it so I got the missing assembly error. Switching the reference to the 2010 version fixed this.

Related

Error while building SSIS project using MSBuild during CI/CD implementation

Can someone assist with the following error which i am getting while building SSIS project using msbuild. I am having Visual studio 2015 in the machine. Using MSBuild 14.0
"*
error MSB4041: Th e default XML namespace of the project must be the
MSBuild XML namespace. If the project is authored in the MSBuild 200 3
format, please add
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the
element. If the proje ct has been authored in the old 1.0 or
1.2 format, please convert it to MSBuild 2003 format.
*"
I have gone through some articles online but couldn't find solution with this scenario.
*" I have gone through some articles online but couldn't find solution with this scenario.
I'm afraid the answer is negative. For now this scenario(build SSIS project using msbuild) is not supported.
Someone has post this issue in DC forum, see Support SSIS, SSRS, SSAS in MSBuild. So if you're trying to use azure devops for CI/CD process, please vote and track this issue to get notifications when there's any update. And if you're using other tools for CI/CD process, I suggest you open a new feature request to support SSIS building for stand-alone msbuild tools in local machine.
And here're two workarounds which may help:
1.Since you have VS2015 installed, instead of msbuild command, you can try using devenv command.
For VS2015, we can find devenv.exe and devenv.com in path C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE. Both devenv.exe and devenv.com works for this, but note: Using devenv.exe directly prevents output from appearing on the console.
So devenv.xxx ... xxx.dtproj /build can work to build the SSIS project.
2.We can find binary(Microsoft.SqlServer.IntegrationServices.Build.dll) of the SQL Server Data Tools in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE. Then we can use msbuild UsingTask element to call the tasks defined in that assembly.
The core is to call DeploymentFileCompilerTask task for SSIS build in our custom msbuild target after defining this statement:
<UsingTask TaskName="DeploymentFileCompilerTask" AssemblyFile="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.SqlServer.IntegrationServices.Build.dll" />
More details please refer to here and here.
Update:
If we have several Database projects and SSIS projects in same solution. Using command like devenv.com xx.dtproj directly will actually build all projects.
So I suggest we use command in this way:
Open Developer command prompt for VS
cd to solution directory
use command: devenv.com SolutionName.sln /Build Development /Project SolutionName\xxx.dtproj /ProjectConfig Development
This will only build the SSIS project actually.
In addition: If you see the message The project 'DatabaseProjectName.sqlproj' will close once model building has paused. If it doesn't affect your build, just ignore it. After my check if won't actually build Database project(the output of database project is empty) if we use command above.

No tests found to run - while debugging/running Unit test cases -- Visual studio 2017 15.5.1

Error : No tests found to run - while debugging/running C# Unit test
cases -- Visual studio 2017 15.5.1 not discovering test cases.
Framework
Microsoft.NET framework 4.6.1
Added Test adapters as below
MSTest.TestAdapter.1.2.0
MSTest.TestFramework.1.2.0
Test explorer not showing the test cases.
This started happening after upgrading visual studio.
Some unit test projects test cases do not get discovered in the test explorer.
When try to debug or run it says "No tests found to run."
I tried deleting project and recreating it again .. but didn't worked.
Output
[4/3/2018 2:59:25 PM Informational] No tests found to run.
I have updated VS to 15.6.4
Deleting VS test cache files DEL %TEMP%\VisualStudioTestExplorerExtensions
Restarted Visual studio
Test cases got discovered but not debugging
Problem
If I understand you correctly, this is something you observe:
when you run the tests, the following can be seen in the console:
[4/3/2018 2:26:13 PM Informational] ------ Run test started ------
[4/3/2018 2:26:14 PM Warning] No test is available in d:\...\UnitTestProject1.dll. Make sure that test discoverer & executors are
registered and platform & framework version settings are appropriate and try
again.
and the test explorer shows:
What could have happened, and it happened to me a couple of times, that the test discovery is set up for another architecture than your currently set one.
Example
Your current configuration is x64
but, the default test settings might have another one (e.g. x86):
Solution
If you _align the test settings with your current architecture (x86 → x64), the tests should run.
Manual cleanups should not be necessary nowadays, if the solution is configured consistently
I had same problem, make sure you set TestClass to public !
[TestClass]
public class CSharp_JavaScript_ServerResponse_Test
{
}
I had may versions of the Nuget Package installed, I consolidated them into the latest one and it fixed the problem
MSTest.TestAdapter
MSTest.TestFramework
As of today, me using NUnit # VSCode and .NET Core 5.0
was missing Microsoft.NET.Test.SDK NuGet package..
As soon as I added it to ALL test assemblies (i.e.: all .csproj files in solution .sln), everything works fine.
HTH to many who reach this far.
These PackageReferences are in my TestProject.csproj
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.1"/>
<PackageReference Include="NUnit.Console" Version="3.12.0"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0-beta.2"/>
<PackageReference Include="NUnitTestAdapter" Version="2.3.0"/>
<PackageReference Include="NUnit.Extension.NUnitProjectLoader" Version="3.6.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0-release-20210422-02"/>
</ItemGroup>
The accepted answer didn't work for me in isolation but along with this it did:
Exit MSVS
Delete the .vs folder (you may lose a few settings related only to that solution)
Restart MSVS
From the accepted answer, ensure the Test -> Settings -> Def Arch-> matches the code
Load playlist (if applicable)
Build
Test!
Try clearing temp files located in the %TEMP% directory
Delete folder : VisualStudioTestExplorerExtensions in %temp% directory.
Note: This path is generally at C:\Users\(yourusername)\AppData\Local\Temp
In my case, "Build -> Clean Solution" did the trick.
Also, make sure you have both MSTest.TestFramework AND MSTest.TestAdapter Nuget packages installed
Guys
I was having the same problem, and fix it by adding the [TestClass] and [TestMethod], and got my Selenium Automated test library working on VS 2015.
Cheers,
[TestClass]
public class GigHubAutomatedTest
{
[TestMethod]
public void StartApplication()
{
using(IWebDriver googleDriver = new ChromeDriver())
{
// 1. Maximize the browser
googleDriver.Manage().Window.Maximize();
googleDriver.Navigate().GoToUrl("https://www.google.com/");
}
}
}
I did below thing and it resolved my problem
I have updated VS to latest version 15.6.4
Deleting VS test cache files DEL %TEMP%\VisualStudioTestExplorerExtensions
Restarted Visual Studio
Then test cases got discovered but not debugging.
It was giving error as:
Dependency finder domain): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT
VISUAL
STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll'.
Cannot find or open the PDB file.
and similar error for other DLLs as below:
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL
STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.VisualStudio.TestPlatform.Common.dll'.
Cannot find or open the PDB file.
So PDB is a debug information file used by Visual Studio. These are system DLLs, which you don't have debug symbols for.
Go to Tools->Options->Debugging->Symbols and select checkbox "Microsoft Symbol Servers", Visual Studio will download PDBs automatically.
Then I downgraded:
MSTest.TestAdapter.1.2.0 to 1.1.18
MSTest.TestFramework.1.2.0 to 1.1.18
Then restarted VS studio and rebuild.
Still got below error:
System.IO.FileNotFoundException: Could not load file or assembly
'System.Net.Http, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified.
Then I set version to newVersion="4.0.0.0"
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.0.0.0" />
</dependentAssembly>
And it started debugging.
My issue was I was using async-await, and the return type was void. It needs to be Task.
Changed this:
public async void MyTest()
To this:
public async Task MyTest()
You can get this error message if you make the mistake of right-clicking inside the editor then choosing Debug Test(s) when you are NOT in a unit test method (e.g. you have a method Foo() and you put a breakpoint in there and want to run the tests so they cause the breakpoint to be hit...nothing will happen if you choose Debug Test(s) while inside the body of Foo()...you have to go to Test Explorer and choose Debug or use the shortcut Ctrl+T,Ctrl+R).

MsBuild error MSB1025 - System.Threading.Tasks.Dataflow not found (following fake generation problems)

I have a problem with the standard MSBuild.exe used on our Team Build server, the standard version used is in
"C:\Windows\Microsoft.NET\Framework\v4.0.30319", version 4.0.30319.18408 or
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319" respectively (same version).
Using this version leads to Fake dlls not being generated in the same way as on our local development machines (i.e. some fake methods are missing on the server), resulting in broken builds (unit tests) on the TFS.
I updated the build definition template to use the MSBuild version located under "C:\Program Files (x86)\MSBuild\12.0\Bin" as it is more recent (version 12.0.30723.0), however, this results in an error MSB1025, System.Threading.Tasks.Dataflow, Version=4.5.9.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a not found.
Update
Further investigation - manually adding the System.Threading.Tasks.Dataflow.dll with the correct version number to the MSBuild directory results in a broken build with
Unsupported ToolsVersion 12.0
Manually setting the ToolVersion in the Microsoft.TeamFoundation.Build.Workflow.Acitvities.MSBuild element to "4.0" results in a broken build with
Cannot set unknown member "Microsoft.TeamFoundation.Build.Workflow.Activities.MSBuild.ToolVersion"
So... no real improvement.
Any ideas how to fix this?
Fakes is sensitive to the Visual Studio version. Try passing /p:VisualStudioVersion=12.0 to MSBuild arguments. Also avoid handling System.* assemblies manually.

Building InstallShield LE project with MSBuild - Error MSB4062

I work with Visual Studio 2012, and I just switched my deployment tools from NSIS to InstallShield. I've added new projects to my solution for InstallShield installers. When I build in Visual Studio (the IDE) I've no errors, no warnings and I'm happy.
Now, I want to have a script that build the full solution without launching the IDE. But when I run MSBuild in the command line, like that
MSBuild MySolution.sln /t:Build /p:Configuration=Release
I get following error MSB4062
C:\Program Files (x86)\MSBuild\InstallShield\2012SpringLimited\InstallShield.targets(21,3): error MSB4062: The "Microsoft.Build.Tasks.AssignProjectConfiguration" task could not be loaded from the assembly Microsoft.Build.Tasks.v3.5. Could not load file or assembly 'Microsoft.Build.Tasks.v3.5' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
My searches lead me to the conclusion that I must buy the Premier Edition of InstallShield to take profit of ISCmdBuild. But I can't afford it, and I think there might be another solution.
Any idea?
Using Fusion logging the MSBuild checks for the DLL here: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Tasks.v3.5.DLL.
I copied
c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.v3.5.dll
to
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v3.5.dll
And the error is gone.
Alternatively open your *.isproj file and change from "3.5" to "4.0" on top on the tag:
<Project ToolsVersion="3.5"...> --> <Project ToolsVersion="4.0" ...>
Another solution is to force MSBuild to use the x86 platform. See https://stackoverflow.com/a/1074699/870604
If you're building from a TFS build, this can be configured from the build options:
I found the solution. Use the command devenv.exe instead of MSBuild.exe. It will be similar to launching Visual Studio and clicking the Build button. That's all!
devenv.exe MySolution.sln /build Release

Visual Studio Test won't run over a network share

When I try to run my test suite, which works fine under Visual Studio 2008, I get the following error in the Output window:
Error loading J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll: Could not load file or assembly 'file:///J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
Note that these same tests can be viewed in the Test View windows, and run well under Visual Studio 2008, but fail only under VS2010.
Note that PFTest.dll is the test project's name, and the dll is the file created when I compile (which compiles ok).
strong textIn addition to the above, I realised I could not step through code either since the compiled dlls and exe could not be loaded from the shared drive.
This solved the problem.
Edit C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config
Add <loadFromRemoteSources enabled="true"/> under <runtime> so that it looks like this:
<runtime>
<loadFromRemoteSources enabled="true" />
<UseSmallInternalThreadStacks enabled="true" />
...
The gouderadrian's anwser did not worked for me.
I am on a VirtualBox machine with Windows 7 64 bits and Visual Studio 2012.
I had to move the output to a local folder : open the unit tests project properties and in the Build tab, browse the Output path to a local folder. The tests are now detected and can be run.
For Visual Studio 2010 Express for Windows Phone the file you're looking for has the name VDPExpress.exe.config.
MS's docs here: http://msdn.microsoft.com/en-us/library/dd409252.aspx

Resources