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?

2
  • Thanks for pointing out that "duplicate" question. That doesn't work in this case, unfortunately. See adding info to question. Commented May 18, 2017 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. Commented Jul 19, 2018 at 2:57

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.