Re: Very Confused: Class, Imports, ...



Sure, Miguel, you can do that without either.

Just open a command window ( cmd.exe );
make sure that the .Net Framework directory is in your path
( the .Net dir is where the compilers are located (vbc.exe, csc.exe));
navigate to the directory where you have your .vb files,
and run the compile command :

vbc /t:library /out:common.dll common.vb

If you need to import .Net classes, include them in your command line:
vbc /t:library /r:system.dll /r:system.web.dll /out:common.dll common.vb

common.dll will be created/compiled in the current directory.

Move it to the /bin directory of your application and fire away.
If you want to have VS.NET use it, reference it in your project.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:u$Okoe3ZFHA.3280@xxxxxxxxxxxxxxxxxxxxxxx
> Hello Juan,
>
> I use Web Matrix because I feel it's simpler and faster to develop.
> I also have Visual Studio 2003. Is it possible to use the command-line compiler without
> needing to install Visual Studio?
>
> Thanks,
> Miguel
>
> "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
> news:nomailreplies@xxxxxxxxxxx:
>
>> Shapper,
>>
>> what you need to do is compile common.vb to common.dll using the
>> command-line compiler (vbc.exe) and reference *that* in your VS.NET project.
>>
>> vbc /t:library /out:common.dll common.vb
>>
>> If you need to import .Net classes, include them in your command line:
>> vbc /t:library /r:system.dll /r:system.web.dll /out:common.dll common.vb
>>
>> Once your assembly ( common.dll ) is compiled,
>> place it in the /bin directory of your application
>> and you will be able to call any of its functions.
>>
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Español
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
>> news:%23R6LUt2ZFHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> > Hello,
>> >
>> > I am working in a web site where all the code is placed in aspx.vb files.
>> > After a while I realized that many functions included in my aspx.vb files where
>> > common
>> > to all pages.
>> >
>> > I created a new file named common.vb where I created a class named common and where I
>> > place all common functions:
>> >
>> > Imports System
>> >
>> > Public Class Common
>> > Public Shared Sub MyFunction01()
>> > ...
>> > End Sub
>> > ... End Class
>> >
>> > In my aspx.vb file I have:
>> >
>> > Imports Common
>> >
>> > Public Class myPage
>> >
>> > Inherits System.Web.UI.Page
>> > Private Sub Page_Load(
>> > MyFunction01()
>> > End Sub
>> >
>> > This is all I have. I get the error:
>> > Namespace or Type 'common' for the Imports 'common' cannot be found.
>> >
>> > Basically all I need is to use Common functions in my aspx pages class.
>> >
>> > Can someone tell me specifically what am I doing wrong?
>> >
>> > Thanks,
>> > Miguel
>> >
>> >
>


.



Relevant Pages

  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • RE: Console Application Testing
    ... vbc.exe could be accessed in Visual Studio Command ... If you want to compile the project in command prompt with vbc.exe, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: iTunes questions
    ... Its time Apple woke up. ... keyboard shortcuts are conspicuously absent. ... they also gave the common actions keyboard equivalents, which is much, ... Every commonly used command or option should have a kb shortcut. ...
    (comp.sys.mac.apps)
  • Re: Macro prompt
    ... I'm sorry, Pcman, I don't think I can help here. ... If you want to test the action of clicking a command button on a form, I suggest you test it by clicking the command button on the form, not by trying to run the Click event code from within the VBE window. ... Steve Schapel, Microsoft Access MVP ... options pop-up menu the the "Compile" section has already checked off Compile ...
    (microsoft.public.access.macros)
  • Re: Using MATLAB functions in C code
    ... interface to MATLAB engine.When I tried to ... option files needed.The command is as follows: ... MATLAB fft amd ifft functions.I just want to compile them like: ... int mlhs, mrhs; ...
    (comp.soft-sys.matlab)