PDA

View Full Version : how to build an dll file?


cool_man77
11-14-2003, 08:33 AM
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!

bruce
11-15-2003, 10:41 AM
pls post the error.
[b]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">

cool_man77
11-16-2003, 05:31 AM
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

steurm
11-16-2003, 05:49 AM
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 [quote];C:\winNt\Microsoft.Net\Framework\v1.1.4322</CODE>
which is the path where all .net dlls are situated (just like the vb.exe)

After you have changed it, you'll need to restart your machine.

success

--
Steurm
www.steurm.net/steurm

cool_man77
11-18-2003, 07:02 AM
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!