Chad
Chad

Reputation: 273

namespace Visualstudio does not exist in the namespace Microsoft, missing assembly reference

I inherited a C# Visual Studio 2010 project that I am unable to compile because it’s looking the following reference which I am unable to satisfy.

using Microsoft.VisualStudio.Tools.Applications.Runtime;

I am new to VS but from what I have researched it has something to do with the version Microsoft Office and the .Net framework version. I currently have MS Office 2003 installed (with Project 2010 and Visio 2010). The Solution requires .Net 4.0 but from what I found on the web it looks like MS Office is reverting .Net to an earlier version.

When I type in using Microsoft. Intellisense only shows

So I am missing the {}VisualStudio resource.

Thanks.

Upvotes: 5

Views: 18538

Answers (5)

Jeremy Thompson
Jeremy Thompson

Reputation: 65692

I get the same error message but I was referencing:

using Microsoft.VisualStudio.TestTools.UnitTesting;

The solution for me was changing the target of .Net 4 CLIENT framework to .Net 4.0 FULL framework.

Upvotes: 7

achakravarty
achakravarty

Reputation: 408

Well, sometimes it so happens that you may be referencing the wrong dll in some other project and they might not be throwing an error. I would suggest that you remove the reference (you can identify them by a small yellow warning icon on them) and re add them in all the projects. This should fix the issue. It did for me at least.

Upvotes: 0

Johannes Kommer
Johannes Kommer

Reputation: 6451

As it is an inherited project I'm assuming that the references are all properly in place and you're just missing the runtime required for this namespace.This namespace is part of the Visual Studio 2010 Tools for Office Runtime. Installing the runtime should fix it.

For further information about this namespace please see the MSDN article here.

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1502786

You need to add a reference to the assembly before you can refer to the namespace with a using directive. Right-click on the project's "References" item in Solution Explorer, select "Add reference" and then pick the Microsoft.VisualStudio.Tools.Applications.Runtime assembly - in the version of VS2010 with the extensions I'm using, it's in the "Extensions" part of the "Assemblies" tab, but that may well be due to the productivity extension I'm using. Either way, you should be able to find it somewhere there....

Upvotes: 1

Related Questions