0

I'm trying to build this Visual Studio C# Solution : TreeViewAdv

I get compile errors like this:

Using Directive is unnecessary The type or namespace name 'VisualStudio' could not be found (are you missing a using directive or an assembly reference?)

on the line:

using Microsoft.VisualStudio.TestTools.UnitTesting;

So I remove that line I get this error:

Error CS0246 The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?)

This question says to add a reference, but I don't see the reference it refers to.

What gives?

Code example:

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
using Aga.Controls.Tree;
using System.Collections.ObjectModel;
namespace Aga.Controls.UnitTests
{
    /// <summary>
    ///This is a test class for Aga.Controls.Tree.TreeNodeAdv and is intended
    ///to contain all Aga.Controls.Tree.TreeNodeAdv Unit Tests
    ///</summary>
    [TestClass()]
    public class TreeNodeAdvTest
    {
        private TestContext testContextInstance;

Edit: In response to the "duplicate" flag:
The directory C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE does not have a Public Assemblies folder. Also I don't have a C:\Program Files\Microsoft Visual Studio 15.0, which I can't say that I understand. Maybe 15 is using the 12 directories?

Community
  • 1
  • 1
Al Lelopath
  • 6,448
  • 13
  • 82
  • 139
  • Thanks for pointing out that "duplicate" question. That doesn't work in this case, unfortunately. See adding info to question. – Al Lelopath May 18 '17 at 17:23
  • 1
    Have you figured it out? I try to build TreeViewAdv. VS2015 updates some solution and project files firstly. The reference Microsoft.VisualStudio.TestTools.UnitTesting in project Aga.Control.Unit.Tests shows warning, so I remove it. Finally, follow the steps in the "duplicate" question. And now, VS2015 builds and tests TreeViewAdv. – Ben Lee Jul 19 '18 at 02:57

1 Answers1

1

With Visual Studio 2013 I do the following steps to build the project:

  1. Remove the reference Microsoft.VisualStudio.TestTools.UnitTesting from the project Aga.Control.Unit.Tests

  2. Add the same reference but from this directory C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies.

ZanAl
  • 73
  • 1
  • 3