The frameowk is probably getting confused because that function doesn't
require the VisualBasic library at all. You can say the exact same thing
with System.DateTime.Now.Year.ToString(). If the System and
Microsoft.VisualBasic namespaces are both imported, how does the
DateTime.Now.Year.ToString() code know which namespace you are referencing?
It doesn't, which is why it generates the error unless the VisualBasic
namespace is specified as then there isn't any confusion by the compiler.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"darrel" <no*****@hotmail.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
I've built a control. At the top of my control, I have this:
Imports Microsoft.VisualBasic
Then, later, I call a function like this:
DateTime.Now.Year.ToString()
This works fine on my machine. My coworker takes the exact same file,
compiles it, and gets errors until he explicitly writes out the function
as:
microsoft.VisualBasic.DateAndTime.Now.Year.ToStrin g()
Why?
This has happened before and only seems to affact the
microsoft.VisualBasic
namespace. On his computer, it just doesn't seem to import it.
-Darrel