VB.Net not building added file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    VB.Net not building added file

    I am using VB.Net 2003 and have added an existing file to my project but
    can't seem to get the file to compile and my other file is getting errors
    when refering to it.

    The file starts out:
    *************** *************** *************** **********
    Imports System
    Imports System.Data
    Imports System.Data.Sql Client

    Namespace MyFunctions

    ' DbObject is the class from which all classes in the Data Services Tier
    ' inherit. The core functionality of establishing a connection with the
    ' database and executing simple stored procedures is also provided by
    ' this base class.
    ' ---
    Public Class DbObject
    *************** *************** *************** ***********

    The file has "MyFunction s" as its' namespace and DbObject as the class.

    But in my main file I have the following:

    *************** *************** *************** *************
    Imports System.Threadin g
    Imports System.Data
    Imports System.Data.Sql Client
    Imports System.IO
    Imports FtsData
    Imports MyFunctions

    Module Module1
    Dim SqlConnection1 As SqlConnection
    Public debugging As Boolean = True
    Dim strProgress As String
    Dim mutexFile As Mutex
    Dim strErrors As String
    Dim newPosition As Position
    Dim myDbObject As New DbObject
    *************** *************** *************** *********

    I get the errors:

    Namespace or type 'MyFunctions' for the Imports 'MyFunctions' cannot be
    found.
    Type 'DbObject' is not defined.

    Why is this? Why won't it build the added file?

    Thanks,

    Tom




  • tshad

    #2
    Re: VB.Net not building added file

    My mistake.

    The file is being built. I looked at the bin folder and found DbObject.dll
    there.

    What was happening was that I still had to manually add a reference to it.
    I would have thought that if the project was building the .dll, it would
    automatically know about the reference. Apparently I was wrong there.

    Definately not intuitive.

    Tom

    "tshad" <t@home.comwrot e in message
    news:%23OQqEfGq HHA.2652@TK2MSF TNGP02.phx.gbl. ..
    >I am using VB.Net 2003 and have added an existing file to my project but
    >can't seem to get the file to compile and my other file is getting errors
    >when refering to it.
    >
    The file starts out:
    *************** *************** *************** **********
    Imports System
    Imports System.Data
    Imports System.Data.Sql Client
    >
    Namespace MyFunctions
    >
    ' DbObject is the class from which all classes in the Data Services Tier
    ' inherit. The core functionality of establishing a connection with the
    ' database and executing simple stored procedures is also provided by
    ' this base class.
    ' ---
    Public Class DbObject
    *************** *************** *************** ***********
    >
    The file has "MyFunction s" as its' namespace and DbObject as the class.
    >
    But in my main file I have the following:
    >
    *************** *************** *************** *************
    Imports System.Threadin g
    Imports System.Data
    Imports System.Data.Sql Client
    Imports System.IO
    Imports FtsData
    Imports MyFunctions
    >
    Module Module1
    Dim SqlConnection1 As SqlConnection
    Public debugging As Boolean = True
    Dim strProgress As String
    Dim mutexFile As Mutex
    Dim strErrors As String
    Dim newPosition As Position
    Dim myDbObject As New DbObject
    *************** *************** *************** *********
    >
    I get the errors:
    >
    Namespace or type 'MyFunctions' for the Imports 'MyFunctions' cannot be
    found.
    Type 'DbObject' is not defined.
    >
    Why is this? Why won't it build the added file?
    >
    Thanks,
    >
    Tom
    >
    >
    >
    >

    Comment

    • Chris Dunaway

      #3
      Re: VB.Net not building added file

      On Jun 6, 1:34 pm, "tshad" <t...@home.comw rote:
      My mistake.
      >
      The file is being built. I looked at the bin folder and found DbObject.dll
      there.
      >
      What was happening was that I still had to manually add a reference to it.
      I would have thought that if the project was building the .dll, it would
      automatically know about the reference. Apparently I was wrong there.
      >
      Definately not intuitive.
      >
      Tom
      >
      "tshad" <t...@home.comw rote in message
      >
      news:%23OQqEfGq HHA.2652@TK2MSF TNGP02.phx.gbl. ..
      >
      I am using VB.Net 2003 and have added an existing file to my project but
      can't seem to get the file to compile and my other file is getting errors
      when refering to it.
      >
      The file starts out:
      *************** *************** *************** **********
      Imports System
      Imports System.Data
      Imports System.Data.Sql Client
      >
      Namespace MyFunctions
      >
      ' DbObject is the class from which all classes in the Data Services Tier
      ' inherit. The core functionality of establishing a connection with the
      ' database and executing simple stored procedures is also provided by
      ' this base class.
      ' ---
      Public Class DbObject
      *************** *************** *************** ***********
      >
      The file has "MyFunction s" as its' namespace and DbObject as the class.
      >
      But in my main file I have the following:
      >
      *************** *************** *************** *************
      Imports System.Threadin g
      Imports System.Data
      Imports System.Data.Sql Client
      Imports System.IO
      Imports FtsData
      Imports MyFunctions
      >
      Module Module1
      Dim SqlConnection1 As SqlConnection
      Public debugging As Boolean = True
      Dim strProgress As String
      Dim mutexFile As Mutex
      Dim strErrors As String
      Dim newPosition As Position
      Dim myDbObject As New DbObject
      *************** *************** *************** *********
      >
      I get the errors:
      >
      Namespace or type 'MyFunctions' for the Imports 'MyFunctions' cannot be
      found.
      Type 'DbObject' is not defined.
      >
      Why is this? Why won't it build the added file?
      >
      Thanks,
      >
      Tom
      If you have the source code for the .dll, dont reference the .dll
      directly, instead reference the project. That is the preferred
      method.

      Chris

      Comment

      • tshad

        #4
        Re: VB.Net not building added file


        "Chris Dunaway" <dunawayc@gmail .comwrote in message
        news:1181223201 .594642.60740@p 47g2000hsd.goog legroups.com...
        On Jun 6, 1:34 pm, "tshad" <t...@home.comw rote:
        >My mistake.
        >>
        >The file is being built. I looked at the bin folder and found
        >DbObject.dll
        >there.
        >>
        >What was happening was that I still had to manually add a reference to
        >it.
        >I would have thought that if the project was building the .dll, it would
        >automaticall y know about the reference. Apparently I was wrong there.
        >>
        >Definately not intuitive.
        >>
        >Tom
        >>
        >"tshad" <t...@home.comw rote in message
        >>
        >news:%23OQqEfG qHHA.2652@TK2MS FTNGP02.phx.gbl ...
        >>
        >I am using VB.Net 2003 and have added an existing file to my project but
        >can't seem to get the file to compile and my other file is getting
        >errors
        >when refering to it.
        >>
        The file starts out:
        *************** *************** *************** **********
        Imports System
        Imports System.Data
        Imports System.Data.Sql Client
        >>
        Namespace MyFunctions
        >>
        ' DbObject is the class from which all classes in the Data Services
        Tier
        ' inherit. The core functionality of establishing a connection with
        the
        ' database and executing simple stored procedures is also provided by
        ' this base class.
        ' ---
        Public Class DbObject
        *************** *************** *************** ***********
        >>
        The file has "MyFunction s" as its' namespace and DbObject as the class.
        >>
        But in my main file I have the following:
        >>
        *************** *************** *************** *************
        Imports System.Threadin g
        Imports System.Data
        Imports System.Data.Sql Client
        Imports System.IO
        Imports FtsData
        Imports MyFunctions
        >>
        Module Module1
        Dim SqlConnection1 As SqlConnection
        Public debugging As Boolean = True
        Dim strProgress As String
        Dim mutexFile As Mutex
        Dim strErrors As String
        Dim newPosition As Position
        Dim myDbObject As New DbObject
        *************** *************** *************** *********
        >>
        I get the errors:
        >>
        Namespace or type 'MyFunctions' for the Imports 'MyFunctions' cannot be
        found.
        Type 'DbObject' is not defined.
        >>
        Why is this? Why won't it build the added file?
        >>
        Thanks,
        >>
        Tom
        >
        If you have the source code for the .dll, dont reference the .dll
        directly, instead reference the project. That is the preferred
        method.
        >
        How do you reference the probject?

        When you add a reference - you need to point at a .dll? I don't believe you
        can reference the project.

        Thanks,

        Tom
        Chris
        >

        Comment

        • Chris Dunaway

          #5
          Re: VB.Net not building added file

          On Jun 7, 4:00 pm, "tshad" <t...@home.comw rote:
          "Chris Dunaway" <dunaw...@gmail .comwrote in message
          >
          news:1181223201 .594642.60740@p 47g2000hsd.goog legroups.com...
          >
          On Jun 6, 1:34 pm, "tshad" <t...@home.comw rote:
          My mistake.
          >
          The file is being built. I looked at the bin folder and found
          DbObject.dll
          there.
          >
          What was happening was that I still had to manually add a reference to
          it.
          I would have thought that if the project was building the .dll, it would
          automatically know about the reference. Apparently I was wrong there.
          >
          Definately not intuitive.
          >
          Tom
          >
          "tshad" <t...@home.comw rote in message
          >
          >news:%23OQqEfG qHHA.2652@TK2MS FTNGP02.phx.gbl ...
          >
          I am using VB.Net 2003 and have added an existing file to my project but
          can't seem to get the file to compile and my other file is getting
          errors
          when refering to it.
          >
          The file starts out:
          *************** *************** *************** **********
          Imports System
          Imports System.Data
          Imports System.Data.Sql Client
          >
          Namespace MyFunctions
          >
          ' DbObject is the class from which all classes in the Data Services
          Tier
          ' inherit. The core functionality of establishing a connection with
          the
          ' database and executing simple stored procedures is also provided by
          ' this base class.
          ' ---
          Public Class DbObject
          *************** *************** *************** ***********
          >
          The file has "MyFunction s" as its' namespace and DbObject as the class.
          >
          But in my main file I have the following:
          >
          *************** *************** *************** *************
          Imports System.Threadin g
          Imports System.Data
          Imports System.Data.Sql Client
          Imports System.IO
          Imports FtsData
          Imports MyFunctions
          >
          Module Module1
          Dim SqlConnection1 As SqlConnection
          Public debugging As Boolean = True
          Dim strProgress As String
          Dim mutexFile As Mutex
          Dim strErrors As String
          Dim newPosition As Position
          Dim myDbObject As New DbObject
          *************** *************** *************** *********
          >
          I get the errors:
          >
          Namespace or type 'MyFunctions' for the Imports 'MyFunctions' cannot be
          found.
          Type 'DbObject' is not defined.
          >
          Why is this? Why won't it build the added file?
          >
          Thanks,
          >
          Tom
          >
          If you have the source code for the .dll, dont reference the .dll
          directly, instead reference the project. That is the preferred
          method.
          >
          How do you reference the probject?
          >
          When you add a reference - you need to point at a .dll? I don't believe you
          can reference the project.
          >
          Thanks,
          >
          Tom
          >
          Chris
          When you add a reference, choose the Projects tab and reference the
          project directly. Here's an older article that discusses the
          advantages of referencing the project. Obviously, if you don't have
          the project and only have a .dll, you have to reference the .dll.

          This link is from Chapter 4, Managing Dependencies

          Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


          Chris


          Comment

          Working...