Vb .net,notepad and adding a reference

anthony

Newcomer
Joined
Jun 14, 2002
Messages
24
I've become frustrated with using the Visual basic standard edition.You're
mostly limited to the stock provided dll's and can't really import new ones.
I think I'd be interested in learning how to program vb .net completely from notepad.
I ran and debugged a simple application from the command line.The
problem was when I tried importing a reference to system.Windows.forms
and got a class not recognized error,yet it imported system.io just fine.
When I used java I just adding the dll's to the directory and used the imports statement and everything worked,but not with vb .net.
How do you add references in notepad?Does anybody have any links for
developing vb .net with notepad?
 
Imports vs References

Import statements and references are two very different things:

Import statements refer to namespaces, and basically allow you to alias types in code so that you do not need to use the fully qualified class name. For example, without importing the System.Windows.Forms namespace, I would have to write System.Windows.Forms.Form every time I used a form in code. By importing the namespace, I can type just Form and the compiler will find it in the imported namespaces (if it exists).

References, on the other hand, refer to the actual libraries (DLLs) which are linked into the project.

The reason System.IO works for you and System.Windows.Forms does not is that most, if not all, of the System.IO classes reside within the DLLs which tend to be referenced by default (mscorlib.dll and possibly System.dll). To use classes within System.Windows.Forms you must reference System.Windows.Forms.dll. Again, note that this has nothing to do with Import statements, and you should be able to do this within your Visual Basic Standard Edition by right-clicking the project icon and selecting Add Reference.

Good luck :cool:
 
If you are using vbc on the command line, you would add a reference with the /r flag. I haven't messed with that stuff in a while. Check out vbc /help for more info. Probably a batch file-esqu build script would if you want to drop the IDE.

Unless you really need it (which you very likely don't), I'd stick to the IDE as MrPaul showed if I were you. On the other hand, if you're in VS 2003, coming from a Java background, you might feel more comfortable with NAnt.
 
Thanks Mskeel.I just don't feel like laying out a lot of money for the proffesional version.People program java and Php in notepad.As I say, the
vb .net standard edition is very limited for importing dll's.
 
Are you using Visual Basic.Net Standard 2003? If that is the case, I have used that version and don't find it to be limited whatsoever. :confused:

Also, if you really don't want to use Visual Studio, there are free IDE's out there. #develop has a good reputation. Also, there are text editors with much better coding support that notepad such as Textpad, PSPad, and notepad++ to name a few off the top of my head.http://www.icsharpcode.net/OpenSource/SD/
 
I've used the free Express versions and they allow adding references to standard libraries such as Windows.Forms. At least, I'm about 95% sure they do.

While you could program in Notepad, your productivity will be greatly reduced. I'd strongly suggest finding some kind of real IDE. There are a bunch of free ones in open source and many others that are cheap ($20 or so). ANYTHING would be better than notepad unless you're doing the simplest of coding examples. If you're doing such simple coding, then the Standard edition should be fine.

I'd look into the #develop as mentioned as I hear it's quite good. You may like UltraEdit or TextPad as well, plus any number of free open source IDEs (even ones for Java have command line tools which would allow for calling out to the compiler).

If you really want to learn how to program .NET from notepad, then do some google searches for something like ".net notepad". There are lots of hits. You'll need to decide how much of a learning curve you like, as using notepad means opening every file yourself (you won't see a list of project files) as well as figuring out all the command line arguments manually.

-ner
 
Coding in Notepad...

Mate.Go back to sleep.Read what I said properly.

I understand that you weren't asking about problems with references, but I felt that it would be better to help you with your original problem than with coding in Notepad, which most programmers would agree is unnecessary. Although you can write Java and PHP code in Notepad, most people do not, as there are many free and commercial IDEs available for most platforms. The same applies to VB.Net and almost all other languages. mskeel and Nerseus have listed a few.

As far as misinterpreting your post goes, there were three parts to that:

I've become frustrated with using the Visual basic standard edition.You're
mostly limited to the stock provided dll's and can't really import new ones

Firstly, I do not believe Visual Basic.Net Standard Edition restricts the DLLs you can reference. I'd be interested to know what references you are trying to add which it won't allow. Both mskeel and Nerseus appear to reflect my skepticism here.

The
problem was when I tried importing a reference to system.Windows.forms
and got a class not recognized error,yet it imported system.io just fine.

Secondly, you claim you "imported a reference" to System.Windows.Forms which failed to compile, but imported System.IO just fine. Since System.IO is not a reference, this indicates that you aren't aware of the difference between references and namespaces, and that the VB.Net Imports statement is not related to referencing external DLLs and is to aid code readability only.

When I used java I just adding the dll's to the directory and used the imports statement and everything worked,but not with vb .net.

Thirdly, you are comparing the way Java compiles to the way VB.Net compiles, which is like comparing apples with oranges. The VB.Net Imports statement and the Java import statement are two entirely different things. The Java statement instructs the compiler to find a specific external package or class, using the CLASSPATH environment variable and other special directories (such as the current one). The VB.Net Imports statement has absolutely nothing to do with external libraries, references etc.

A lot of the threads I've read on this forum are started by people asking for help with a solution when they should really be asking about the problem which prompted the solution. In this case I got the impression that you believe that the Standard Edition is limited, when really it isn't, and that you weren't clear on the difference between importing a namespace and adding a reference. If I was mistaken then I apologise, and I'll waste no more of your thread. I hope you enjoy programming in Notepad.

Good luck :rolleyes:
 
anthony, please read the Posting Guidelines. Please, (ala posting guidelines) keep it civil and do not insult or disparage members. MrPaul was trying to help, and just because the scope of his answer does not exactly match the scope of your question does not mean that it isn't helpful.

Indeed, no version of Visual Basic restricts which DLLs you can and can't reference or import. From the wording of your first post, it certainly does appear that you are confused about the difference between importing and referencing. VB is different in this regard from Java. To use classes you must always reference their DLL file. Importing namespaces is a syntax feature. If the answers you have been given are insufficient you should clarify as to whether your problem is related to importing or referencing namespaces.

Also, you should investigate the Express versions of Visual Studio. They are free, and for most purposes they are almost as good as the professional versions.
 
My apoligies to Mrpaul.You handled it well.Most sorry.

As far as dll's go,the only ones I've really used are things like the web browser control and the windows mediaplayer control.I guess I panicked
trying to use the shell32 dll,when I got a "Guid is not valid,or not
registered error" on some notification function.Funny enough it works fine for the simpler shell functions.
The vb .net standard edition does have limits though(i.e no class
library,etc).I just think it would be good to learn how to do everything in notepad,eventually much more cost effective,and you would understand more clearly how the assembly and resource files etc fit together.I mean you can't upgrade the standard edition,and at about 1,000 Canadian dollars the proffessional one is a little expensive.
As far as I remember I believe there is deployment issues with the free vb .net express edition.Why build something if you can't deploy it?Right now I have the standard edition,
but I'm just thinking of the future.The next ide/programming software I might get next could very well be Borland C++,but I would still like to keep abreasrt of vb .net
Anyway thanks for the replies.
 
Back
Top