I have a windows application developed in Visual Studio 2015 professional, Framework - 4.6.1 .I have written unit test cases for this windows service using MStest. If I build this application locally on my machine, the build is successful (build is done by Visual Studio -> Build-> Build Solution and through MSBuild).
Now I have a VM where visual studio 2015 is not installed.But has VS2017 installed on it. Now I'm trying to build my application by MSBuild through Bamboo. It gives the following errors on it .
UnitTest1.cs(2,17): error CS0234: The type or namespace
name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you
missing an assembly reference?)
[C:\Users\Administrator\bamboo-home\xml-data\build-dir\GUI-DEV-JOB1\UnitTestGUI\UnitTestGUI.csproj]
UnitTest1.cs(9,10): error CS0246: The type or namespace
name 'TestMethod' could not be found (are you missing a using directive
or an assembly reference?)
[C:\Users\Administrator\bamboo-home\xml-data\build-dir\GUI-DEV-JOB1\UnitTestGUI\UnitTestGUI.csproj]
UnitTest1.cs(9,10): error CS0246: The type or namespace
name 'TestMethodAttribute' could not be found (are you missing a using
directive or an assembly reference?)
[C:\Users\Administrator\bamboo-home\xml-data\build-dir\GUI-DEV-JOB1\UnitTestGUI\UnitTestGUI.csproj]
UnitTest1.cs(6,6): error CS0246: The type or namespace
name 'TestClass' could not be found (are you missing a using directive
or an assembly reference?)
[C:\Users\Administrator\bamboo-home\xml-data\build-dir\GUI-DEV-JOB1\UnitTestGUI\UnitTestGUI.csproj]
UnitTest1.cs(6,6): error CS0246: The type or namespace
name 'TestClassAttribute' could not be found (are you missing a using
directive or an assembly reference?)
[C:\Users\Administrator\bamboo-home\xml-data\build-dir\GUI-DEV-JOB1\UnitTestGUI\UnitTestGUI.csproj]
The errors are quite confusing because I have referenced to Microsoft.VisualStudio.QualityTools.UnitTestFramework
, but still showing these error.
The reason for these errors which I feel is as follows (which can be completely wrong).
There is no Visual Studio 2015 on my build environment which is causing this problem. or
When I look at the properties for this particular reference in my code, the path for this is displayed as "
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
". But there is no folder with nameMicrosoft Visual Studio 14.0
in my VM where I'm building the code. How do I get this. Is it by installing Visual Studio 2015?
Can anyone help me in solving this as I'm stuck here.