how to build an dll file?

Discussion in 'ASP.NET / ASP.NET Core' started by cool_man77, Nov 14, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. My website store in a virtual directory is C:\inetpub\wwwroot\MySite
    The vbCb.vb build for this website store in the same folder
    And vbc.exe in C:\winNt\Microsoft.Net\Framework\v1.1.4322
    I want to build a vbCb.dll in C:\inetpub\wwwroot\MySite\bin.

    I run: C:\winNt\Microsoft.Net\Framework\v1.1.4322\vbc /reference:Microsoft.VisualBasic.dll /out:C:\inetpub\wwwroot\MySite\bin\vbCb.dll /t:library C:\inetpub\wwwroot\MySite\vbCb.vb

    But when enter that command, It had error...

    Please anyone have experience with this problem help me to solve. Thanks for all response!
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    pls post the error.
    quote:Originally posted by cool_man77

    My website store in a virtual directory is C:\inetpub\wwwroot\MySite
    The vbCb.vb build for this website store in the same folder
    And vbc.exe in C:\winNt\Microsoft.Net\Framework\v1.1.4322
    I want to build a vbCb.dll in C:\inetpub\wwwroot\MySite\bin.

    I run: C:\winNt\Microsoft.Net\Framework\v1.1.4322\vbc /reference:Microsoft.VisualBasic.dll /out:C:\inetpub\wwwroot\MySite\bin\vbCb.dll /t:library C:\inetpub\wwwroot\MySite\vbCb.vb

    But when enter that command, It had error...

    Please anyone have experience with this problem help me to solve. Thanks for all response!
    </blockquote id="quote"></font id="quote">
     
  3. I wrote in vbCb.vb:

    Option Strict Off
    Imports System
    Imports System.Web.UI.WebControls
    NameSpace myVbCodeBehind
    Public class vbCb : Inherits System.Web.UI.Page
    Public lstFlowers As System.Web.UI.WebControls.ListBox
    Public lblMessage As System.Web.UI.WebControls.Label
    Public btnSubmit As System.Web.UI.WebControls.Button
    Protected Sub Page_Load(ByVal sender As Object, Byval e As EventArgs)
    if not Page.isPostBack then
    lblMessage.Text="No Selection Yet"
    lstFlowers.Items.Add(new ListItem("Tulip"))
    lstFlowers.Items.Add(new ListItem("Rose"))
    lstFlowers.SelectedIndex=0
    end if
    End Sub
    End Class
    End Namespace

    When I build it the error I receive is:

    C:\inetpub\wwwroot\test\vbCb.vb(3) : error BC30466: Namespace or type 'WebControls' for the Imports 'System.Web.UI.WebControls' cannot be found.

    Imports System.Web.UI.WebControls
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(5) : error BC30002: Type 'System.Web.UI.Page' is not defined.

    Public class vbCb : Inherits System.Web.UI.Page
    ~~~~~~~~~~~~~~~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(6) : error BC30002: Type 'System.Web.UI.WebControls.ListBox' is not defined.

    Public lstFlowers As System.Web.UI.WebControls.ListBox
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(7) : error BC30002: Type 'System.Web.UI.WebControls.Label' is not defined.

    Public lblMessage As System.Web.UI.WebControls.Label
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(8) : error BC30002: Type 'System.Web.UI.WebControls.Button' is not defined.

    Public btnSubmit As System.Web.UI.WebControls.Button
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(10) : error BC30451: Name 'Page' is not declared.

    if not Page.isPostBack then
    ~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(12) : error BC30002: Type 'ListItem' is not defined.

    lstFlowers.Items.Add(new ListItem("Tulip"))
    ~~~~~~~~
    C:\inetpub\wwwroot\test\vbCb.vb(13) : error BC30002: Type 'ListItem' is not defined.

    lstFlowers.Items.Add(new ListItem("Rose"))

    Thanks for anyhelp
     
  4. I think you have to change your system variables of your machine. when you use VS.net, it is changed automatically. Since you create your own compilationfiles, you have to add the reference to the dll's of .NET to your system variables.

    rightclick on "My Computer", go to properties > advanced > Environment Variables

    Edit the 'path' system variable and add something like
     
  5. Ok, I can build this file to dll.

    The command correct is:

    vbc /out:..\bin\vbCb.dll /t:library ..\vbCb.vb /r:System.Data.dll /r:system.dll /r:System.Web.dll

    We save this code to a make.bat file and go to cmd prompt type make.bat for complile this file.

    Thanks Steurm!
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page