Is there a "search all assemblies" ability?

i'm getting a random, and typical:

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

on the line

publicpartialclassLayoutView : DevExpress.XtraEditors.XtraUserControl

Aside from that error message being the most condescending thing ever, i'm trying to find the easy way to fix it.

i know that these DevExpress controls are available globally, but be damned if i know what using and reference i need to add. i randomly try

using DevExpress.XtraEditors;

But of course doing just that doesn't solve it. In Delphi it was easy, i would have the IDE search the source it can find, and look for that class. When i found the filename, i would add it:

uses XtraEditors;

And i'd be done with it. Now i have to know the namespace (so i can add it as a using), i also have to know what dll (i.e. assembly, so i can add it with a references)

Is this it? Is this what everyone has to do in Visual Studio? This is the best Microsoft can come up with?

How about a feature where the IDE will search all assemblies it can find on the computer, and let me pick the one that's the right one. It will then add the using and references. i really don't know what namespace and file it's in...can't we get a computer to do this tedious labor? Computers are pretty good at searching stuff. Besides, assemblies are stored on computers these days.

So the question is: is there a program/addin/feature/ability that will find the assembly and namespace i'm missing, and add it?

This is where Eclipse's "Ctrl+1" feature was great. If you were missing something, you'd hit Ctrl+1, and it would add the stuff. It's the comptuer - it already knows where the assembly is, it knows what namespace it's in. Can you just do it for me?

Barring that...how youyou proceed to resolve the error of missing stuff? You don't know what file it's in, you don't know where, you don't know what it's called. How wouldyou proceed? There must be a secret technique that i'm missing - there's no way i'd have to be forced to figure out what namespace and assembly a thing is in, and have to add the using and right-click and add the .dll manually every time.

There must be a trick.

[3368 byte] By [JackTripper] at [2008-1-10]
# 1

For most .NET System.* namespace/assemblies the MSDN documentation will list the assembly as part of the documentation right near the namespace

In this case DevExpress has some online help that tells you it is in the DevExpress.Utils.v7.2.dll

http://www.devexpress.com/Help/?document=XtraUtils/clsDevExpressXtraEditorsXtraUserControltopic.htm&levelup=true

I found this reference using Windows Live and searching for the class name.

VS 2008 is much better and reference resolving and helping manage using statements. While you are using 2005, live search and windows desktop can help you quickly find class names in source, help, and sometimes dlls (espcially if they have .xml documentation near them).

Geoff.Cox at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 2

"Search all assemblies". Where? That would be extremely time consuming.

No, there isn't, you have to explicitly tell Visual Studio what assemblies you're using. Which also means you need to know what assemblies you need to add references too.

From Geoff's link, it suggests you need to have a reference to the assembly DevExpress.Utils.v7.2.dll to access the DevExpress.XtraEditors namespace.

PeterRitchie at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 3

Indeed you pretty much need to add the reference AND the using statement.

So add the reference by selecting references, right clicking and adding the one you need, add your using statement and you're done

Zamial at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 4

> "Search all assemblies". Where? That would be extremely time consuming.

i don't know about that: they have assemblies on computers these days. Computer are pretty fast. The real test is: can a computer search all assemblies faster than a human can hunt through google results?

i just can't belive that this is the best Microsoft can come up with for making my life easier.

JackTripper at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 5

Presumably since you're about to use an API, you would have already known where it is. Otherwise how did you know you wanted to use a DevExpress API in the first place?

eradicator at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 6

Again, when? When the error occurs during a build? Should it automatically search your hard drive for all .exe/.dll files to check if they are an assembly, then search through them to see if the namespace you're using is there? Or should it ask you?

On my system a search for DLL files takes 4 minutes. I can only imagine the added time it takes to see if the file is an assembly, then load it, reflect if it has the namespace required, then unload it (i.e. much longer than just finding DLLs).

I certainly don't want Visual Studio to be asking me questions during a build; that could be an automated process.

Moral is, you have to know what assemblies you need to use when you want to use code from a namespace--not just for adding the reference but for deploying the application.

PeterRitchie at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 7

> Presumably since you're about to use an API, you would have already known where it is.

> Otherwise how did you know you wanted to use a DevExpress API in the first place?

Someone (or something) besides me can generate code.

And to answer your next question: that someone (or something) didn't also setup my development environement. i don't know where arbitrary files are located.

JackTripper at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 8

Jack Tripper wrote:

> Presumably since you're about to use an API, you would have already known where it is.

> Otherwise how did you know you wanted to use a DevExpress API in the first place?

Someone (or something) besides me can generate code.

Talk the the vendor of that tool, it's a bug if it doesn't add the reference to the project for an assembly with namespaces that it requires in the generated code.

Jack Tripper wrote:
And to answer your next question: that someone (or something) didn't also setup my development environement. i don't know where arbitrary files are located.
Talk to the person that setup your development environment; that's information *you need* to know.
PeterRitchie at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...
# 9

> Again, when? When the error occurs during a build?

When i hover over the thing that it can't find.

class: WorkItem

namespace: Microsoft.Practices.CompositeUI.WorkItemStuff

assembly: Microsoft.Practices.CompositeUI.dll

Add using and reference

If the class WorkItem is declared in more than one assembly, then it can offer with a little button in the tooltip to show me

class: WorkItem

Declared in 6 namespaces, 2 assemblies.

Show me

> Should it automatically search your hard drive for all .exe/.dll files to check if they are an assembly,

>then search through them to see if the namespace you're using is there?

Not my entire hard-drive. Just the places that it normally looks

- all assembly references in the solution

- build directory

- GAC

- HKCU/Software/Microsoft/.NETFramework/AssemblyFolders/*

- HKCU/Software/Microsoft/.NETFramework/v2.0.50727/AssemblyFoldersEx/*

- HKLM/Software/Microsoft/.NETFramework/AssemblyFolders/*

- HKLM/Software/Microsoft/.NETFramework/v2.0.50727/AssemblyFoldersEx/*

Everybody, except Visual Studio, knows how to get at System.WinForms.Button class.

For example, add the following to your code:

private CornerRadiusConverter crc;

It doesn't know where CornerRadiusConverter is. i can tell you it's Microsoft's. i try to do a "Find Symbol" search in Visual Studio, searching in the ".NET Framework". i don't know what a ".NET framework symbol search is", but it's not finding this symbol that is in fact in the .NET framwork. Somewhere.

i don't know what namespace, and i don't know what assembly dll, and neither do you.

If only i could get a computer that could search the above locations (or if a Find Symbol in the .NET framework search feature did just that).

> I certainly don't want Visual Studio to be asking me questions during a build; that could be an automated process.

Well it's an error, just like the rest. It doesn't stop the build to tell you about an error. This is when you're trying to resolve errors.

>Moral is, you have to know what assemblies you need to use when you want to use code from a

> namespace--not just for adding the reference but for deploying the application.

Moral is: computers can make people's lives easier, not harder.

JackTripper at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# General...