vbc.exe and assembly info

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

When I compile using vbc.exe, I can't afford vs.net just yet, how do I
specify the information that is usually in the assembly info file, such as
version number and location of the strong name file. Can this be included in
the vb file that is getting complied or is there some way of pointing the
vbc.exe at an assemblyinfo.vb file. And additionally can I specify that the
version number is always the same?
 
The AssemblyInfo.vb is just another source code file that you can
include in your compilation. When you complie something with the
compilers directly, you can include more than one source file. For
more complex builds, you might consider using a tool such as
VisualBuild (costs money) or NAnt (free). I've used both and they make
the manual compilation process a lot simpler.

As far as the version number, just change the setting from dynamic
version numbers (1.0.*) to something you want to use (1.0.0.0). Then,
you can manually update the version numbers when you're ready.


HTH!
CK
 
How do I include via the command line. I have a bat file see below, where do
I point it at. I don't have a clue about the syntax or the theory!!! How do
I 'include' it in the complilation. I think it would make sense if I saw an
example. Is the assembly linker program used for this?

Set indir=C:\Inetpub\wwwroot\sharepoint\hello.vb
Set outdir=C:\Inetpub\wwwroot\sharepoint\hello.dll
Set
assemblies=System.dll,System.Web.dll,System.drawing.dll,System.Data.dll,System.xml.dll


C:\Windows\Microsoft.NET\Framework\v2.0.50727\vbc /t:library /out:%outdir%
%indir% /r:%assemblies%
pause
 
Chris said:
How do I include via the command line. I have a bat file see below,

vbc can take more than one .vb file on the command line:

vbc a.vb b.vb c.vb

all three files will be compiled and put in the final assembly. If you
chose to have a separete file for your assembly level attributes then
just add that file to the command line.

However, you don't have to use a separate file. The assembly level
attributes can be in any source file.
Set indir=C:\Inetpub\wwwroot\sharepoint\hello.vb
Set outdir=C:\Inetpub\wwwroot\sharepoint\hello.dll

just a comment, these are files not directories :-)
Set
assemblies=System.dll,System.Web.dll,System.drawing.dll,System.Data.dll,System.xml.dll


C:\Windows\Microsoft.NET\Framework\v2.0.50727\vbc /t:library
/out:%outdir% %indir% /r:%assemblies%
pause

if your assembly level attributes are in assemblyinfo.vb you can make
the following change to your batch file,

Set indir=C:\Inetpub\wwwroot\sharepoint\hello.vb
C:\Inetpub\wwwroot\sharepoint\assemblyinfo.vb

[all one line, watch for line breaking]

Richard
 
Back
Top