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.
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).
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.
> 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.