Command-line compiler can't find assembly in GAC

F

Frank Rizzo

I have a batch script that is supposed to compile this script:

vbc.exe /main:Form1 /target:winexe
/imports:Microsoft.VisualBasic,System,System.Collections,System.Data,System.Diagnostics,System.Drawing,System.IO,System.Net,System.Text,System.Windows.Forms
/r:System.dll,System.Data.dll,System.Drawing.dll,System.Windows.Forms.dll,Sybase.Data.AseClient.dll
/out:Advanced.exe Form1.vb

When I ran this command, I get an error:

vbc : Command line error BC2017 : could not find library
'Sybase.Data.AseClient.dll'

I know that this library in the GAC, because I can see it in
c:\windows\assembly and the physical folder location of the
Sybase.Data.AseClient.dll is in the Path environment variable.

What am I missing here?

Thanks.
 
M

Mattias Sjögren

Frank,
What am I missing here?

The compiler doesn't look in the GAC, and it probably doesn't look in
all PATH directories either. It does look in the framework directory
and any directories you specify with /lib.



Mattias
 
M

mikeb

Frank said:
I have a batch script that is supposed to compile this script:

vbc.exe /main:Form1 /target:winexe
/imports:Microsoft.VisualBasic,System,System.Collections,System.Data,System.Diagnostics,System.Drawing,System.IO,System.Net,System.Text,System.Windows.Forms
/r:System.dll,System.Data.dll,System.Drawing.dll,System.Windows.Forms.dll,Sybase.Data.AseClient.dll
/out:Advanced.exe Form1.vb

When I ran this command, I get an error:

vbc : Command line error BC2017 : could not find library
'Sybase.Data.AseClient.dll'

I know that this library in the GAC, because I can see it in
c:\windows\assembly and the physical folder location of the
Sybase.Data.AseClient.dll is in the Path environment variable.

What am I missing here?

Thanks.

vbc.exe (and csc.exe) do not search the GAC for compile-time references.

vbc searches:

1) the current working directory
2) the CLR system directory (ie.,
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322, not the GAC)
3) directories specified by /libpath option
4) directories specified by the LIB env. variable

csc.exe has a similar search strategy, except that /lib is used instead
of /libpath.

You'll need to have a copy of the Sybase.Data.AseClient.dll in one of
the above locations (or specify the full file-system directory name for
the GAC located instance)
 
F

Frank Rizzo

mikeb said:
vbc.exe (and csc.exe) do not search the GAC for compile-time references.

vbc searches:

1) the current working directory
2) the CLR system directory (ie.,
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322, not the GAC)
3) directories specified by /libpath option
4) directories specified by the LIB env. variable

Thanks. Step 4 worked for me. BTW, where did you get this info?
 
M

mikeb

Frank said:
Thanks. Step 4 worked for me. BTW, where did you get this info?

It was in the compiler's online docs for the /libpath (or /lib) command
line compiler options.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top