C
Christopher W. Douglas
I'm working in VB.Net, using Visual Studio 2003.
I have a project, let's call it Foo, that contains common methods, forms,
and objects I use in other projects. It compiles as Foo.dll, which I then
reference from the project that needs it.
Let's say I have a method, Bar, that I want to access from another project.
If I add a public module Methods to Foo, and add a public method Bar to
Methods, I can call it from my other project a couple of different ways, and
intellisense acts differently.
This works, but with no intellisense:
Foo.Bar
This works:
Foo.Methods (shows in intellisense)
and then:
Foo.Methods.Bar (shows in intellisense)
If, INSTEAD, I create a public class IO in Foo, and a public shared method
Bar in IO, I can call it like so (without instantiating a copy of the IO
class):
Foo.Bar (doesn't work)
Foo.IO.Bar (works, and shows in intellisense)
However, Microsoft, with their awesome powers, has a Namespace
Microsoft.VisualBasic, with a public module Strings, and a public method
UCase.
This works, even if I don't have Microsoft.VisualBasic imported:
UCase("string") (shows in intellisense)
Microsoft.VisualBasic.UCase("string") (shows in intellisense)
Microsoft.VisualBasic.Strings.UCase("string") (shows in intellisense)
I guess what I want is to have a Foo.dll, with a public module or class,
with the public method Bar, and be able to do this:
Foo.Bar
WITH intellisense. Microsoft can do it, why can't I? I appreciate any
assistance.
I have a project, let's call it Foo, that contains common methods, forms,
and objects I use in other projects. It compiles as Foo.dll, which I then
reference from the project that needs it.
Let's say I have a method, Bar, that I want to access from another project.
If I add a public module Methods to Foo, and add a public method Bar to
Methods, I can call it from my other project a couple of different ways, and
intellisense acts differently.
This works, but with no intellisense:
Foo.Bar
This works:
Foo.Methods (shows in intellisense)
and then:
Foo.Methods.Bar (shows in intellisense)
If, INSTEAD, I create a public class IO in Foo, and a public shared method
Bar in IO, I can call it like so (without instantiating a copy of the IO
class):
Foo.Bar (doesn't work)
Foo.IO.Bar (works, and shows in intellisense)
However, Microsoft, with their awesome powers, has a Namespace
Microsoft.VisualBasic, with a public module Strings, and a public method
UCase.
This works, even if I don't have Microsoft.VisualBasic imported:
UCase("string") (shows in intellisense)
Microsoft.VisualBasic.UCase("string") (shows in intellisense)
Microsoft.VisualBasic.Strings.UCase("string") (shows in intellisense)
I guess what I want is to have a Foo.dll, with a public module or class,
with the public method Bar, and be able to do this:
Foo.Bar
WITH intellisense. Microsoft can do it, why can't I? I appreciate any
assistance.