PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET VS.NET Public Namespaces, classes, Function - Conceptual misunderstanding.

Reply

VS.NET Public Namespaces, classes, Function - Conceptual misunderstanding.

 
Thread Tools Rate Thread
Old 02-04-2006, 02:39 PM   #1
jason@cyberpine.com
Guest
 
Posts: n/a
Default VS.NET Public Namespaces, classes, Function - Conceptual misunderstanding.


Please pardon my completely lack of understanding on the topic.

I have a website I developed with another developer. We are both far
from experts in VB.NET and OOP. We developed the site WITHOUT VS.NET,
compiling vb.net code into a common dll in the bin directory off the
root of the website. That one vb code creates a namespace we import in
all of our ASP.NET code. Compiling was done fromt he command line use
vbc.exec.

The site works well enough.

Now, and please exuse any missuse of OOP terms, we'd like to move the
site to VS.NET and more importantly understand how such a site would
have been developed via VS.NET if a team of developers were building it
and wanted to share code. Some real NOOB type questions below.

1. Because I manually created a DLL, does this classify that as
unmanaged code?
2. In VS.NET, at a high level, how does one create public classes and
functions that ALWAYS available to other developers and applications?
3. We are using VS.NET 2005, I took my vb that compiled into a dll and
Created a new class library, and compiled it. The build seem to run
fine. The code starts like this:

Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Public Class cjason1
Public Function fjason1(ByVal cmd As String) As DataSet

I took the namespace out of the code, but left the imports in, not sure
if that makes sense.

I closed all projects and started a new asp.net website to see I could
find my new class in the object explorer, but I can't.

4. Am I missing something above, and is this how .net developers share
classes? I'm sure I'm completely misguided.

5. How does team explorer, team projects and team foundation work into
what we *THINK* we are trying to do? Keep in mind we are trying to keep
things simple and cheap for starts.

I guess my very noobie question is "how do most shops deploy and manage
classes"

A HUGE THANKS IN ADVANCE TO ANYBODY THAT CAN CLEAR THIS UP FOR ME. I
REALLY DO APPRECIATE ANY HELP YOU CAN GIVE ME!!!!!!!

  Reply With Quote
Old 02-04-2006, 03:27 PM   #2
Scott M.
Guest
 
Posts: n/a
Default Re: VS.NET Public Namespaces, classes, Function - Conceptual misunderstanding.

> 1. Because I manually created a DLL, does this classify that as
> unmanaged code?


No, you code is managed. Whether you created it with VS.NET or Notepad
doesn't matter. The code was compiled and is run within the context of the
Common Langugage Runtime (CLR), which makes it managed code.

> 2. In VS.NET, at a high level, how does one create public classes and
> functions that ALWAYS available to other developers and applications?


When a class is created, it is marked as "Public" and then the methods
(functions) within it are also maked as "Public". Now, all any other
developer needs to do to use this class and its methods (functions) is to
make a reference to it from thier application, make an instance of the class
and call its methods.

> I closed all projects and started a new asp.net website to see I could
> find my new class in the object explorer, but I can't.
>
> 4. Am I missing something above, and is this how .net developers share
> classes? I'm sure I'm completely misguided.


You need to make a project reference from the application that wants to use
the class to the assembly (.dll) that contains the class first. After that,
the class you wish to use will still be inside of a namespace because VS.NET
requires that all classes be in, at least, a Root Namespace. If you took
out your namespace declarations, your Root Namespace is probably the same
name as your assembly (minus the .dll extension).

> 5. How does team explorer, team projects and team foundation work into
> what we *THINK* we are trying to do? Keep in mind we are trying to keep
> things simple and cheap for starts.


Can't help you there as I haven't begun using 2005 yet.

>
> I guess my very noobie question is "how do most shops deploy and manage
> classes"
>
> A HUGE THANKS IN ADVANCE TO ANYBODY THAT CAN CLEAR THIS UP FOR ME. I
> REALLY DO APPRECIATE ANY HELP YOU CAN GIVE ME!!!!!!!
>



  Reply With Quote
Old 02-04-2006, 04:49 PM   #3
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: VS.NET Public Namespaces, classes, Function - Conceptual misunderstanding.

Jason,

In addition to Scott, why do you not just try the Express versions.

To set a commandline for VBC is forever difficult.
But what you ask you have to set in the parameters for that.

With Express all becomes probably easier to understand.

http://msdn.microsoft.com/vstudio/express/

Cor


<jason@cyberpine.com> schreef in bericht
news:1143981568.596191.237790@i39g2000cwa.googlegroups.com...
> Please pardon my completely lack of understanding on the topic.
>
> I have a website I developed with another developer. We are both far
> from experts in VB.NET and OOP. We developed the site WITHOUT VS.NET,
> compiling vb.net code into a common dll in the bin directory off the
> root of the website. That one vb code creates a namespace we import in
> all of our ASP.NET code. Compiling was done fromt he command line use
> vbc.exec.
>
> The site works well enough.
>
> Now, and please exuse any missuse of OOP terms, we'd like to move the
> site to VS.NET and more importantly understand how such a site would
> have been developed via VS.NET if a team of developers were building it
> and wanted to share code. Some real NOOB type questions below.
>
> 1. Because I manually created a DLL, does this classify that as
> unmanaged code?
> 2. In VS.NET, at a high level, how does one create public classes and
> functions that ALWAYS available to other developers and applications?
> 3. We are using VS.NET 2005, I took my vb that compiled into a dll and
> Created a new class library, and compiled it. The build seem to run
> fine. The code starts like this:
>
> Imports System.Data
> Imports System.Data.SqlClient
> Imports System.Collections
> Public Class cjason1
> Public Function fjason1(ByVal cmd As String) As DataSet
>
> I took the namespace out of the code, but left the imports in, not sure
> if that makes sense.
>
> I closed all projects and started a new asp.net website to see I could
> find my new class in the object explorer, but I can't.
>
> 4. Am I missing something above, and is this how .net developers share
> classes? I'm sure I'm completely misguided.
>
> 5. How does team explorer, team projects and team foundation work into
> what we *THINK* we are trying to do? Keep in mind we are trying to keep
> things simple and cheap for starts.
>
> I guess my very noobie question is "how do most shops deploy and manage
> classes"
>
> A HUGE THANKS IN ADVANCE TO ANYBODY THAT CAN CLEAR THIS UP FOR ME. I
> REALLY DO APPRECIATE ANY HELP YOU CAN GIVE ME!!!!!!!
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off