Hi,
> 1) Why does the default VB.NET Add-In code have:
>
> <Assembly: ComVisible(True)>
VS.NET 2002/2003 add-in assemblies are required to be registered as COM
(ActiveX) components using COM Interop (regasm.exe, etc.), so they need to
have that attribute and value. This is no longer required for VS 2005
add-ins.
> <Assembly: CLSCompliant(True)>
>
[quoted text clipped - 3 lines]
> ...in AssemblyInfo.cs, I get several errors about several extensibility
> classes being non-CLS compliant (so how does the VB.NET version compile?).
This attribute is not important and you can ignore it. In VS 2005, even the
VB.NET version causes that non-CLS compliant errors.
> 2) Why does the default VB.NET Add-In have:
>
> Dim applicationObject As EnvDTE.DTE yet the C# version is:
> _DTE applicationObject; (_DTE is actually EnvDTE._DTE)
>
> 3) What's the difference between EnvDTE.DTE and EnvDTE._DTE?
This is answered in the book "Inside Microsoft Visual Studio .NET 2003" but
I don´t remember the answer and I don´t have it here, but I think that _DTE
is an interface and DTE is a class (surely implementing the _DTE interface).
> 4) Why the discrepancy? Why does VB.NET use EnvDTE.DTE and C# uses
> EnvDTE._DTE?
All these discrepancies are because they seem to be written by different
persons, just my guess.
> 5) Using EnvDTE.DTE applicationObject in the C# version (as opposed to
> _DTE applicationObject), why does the VB.NET version have:
> applicationObject.CommandBars.Item["Tools"]
> ...yet in C#, applicationObject.CommandBars does not have a member Item?
> Aren't they both using the same DLL (and are both a EnvDTE.DTE)? If so,
> how can a DLL have conditional code (#ifdef VB.NET -> expose Items
> method???)
"Item" is a default property (in VB.NET terms) or an indexer (in C# terms)
and therefore is omited in C# and optional in VB.NET. VB.NET also works if
you remove it.
> 6) In a lot of the code from "Writing Add-ins for Visual Studio .NET",
> there is a function called MsgBox(). The VS online help says it's in the
> Microsoft.VisualBasic namespace and is within the
> Microsoft.VisualBasic.dll assembly.
> A) Why isn't that dll added to the VB project's reference section?
VB.NET projects use a kind of hidden reference implicitly, in the same way
that the reference to mscorlib.
> B) I added Microsoft.VisualBasic.dll to my C# project, yet
> Microsoft.VisualBasic.MsgBox() does not exist. Again, is there
[quoted text clipped - 3 lines]
> know I can just use System.Windows.Forms.MessageBox.Show() in its place
> but now I'm curious (and baffled) as to where MsgBox() is coming from.
MsgBox is defined in the assembly Microsoft.VisualBasic.dll, namespace
Microsoft.VisualBasic, module Interaction. Since the module name is not
required in VB.NET and the Microsoft.VisualBasic.dll assembly is
automatically added to VB.NET projects, MsgBox just works.

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET,
VB6, VB5 and VBA
You can code, design and document much faster in VB.NET, C#, C++ or VJ#
Free resources for add-in developers:
http://www.mztools.com