By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,236 Members | 2,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,236 IT Pros & Developers. It's quick & easy.

Command-line compiler can't find assembly in GAC

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

vbc.exe /main:Form1 /target:winexe
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Data,System.Diagnostics,System.Drawin g,System.IO,System.Net,System.Text,System.Windows. Forms
/r:System.dll,System.Data.dll,System.Drawing.dll,Sy stem.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.
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #2

P: n/a
Frank Rizzo wrote:
I have a batch script that is supposed to compile this script:

vbc.exe /main:Form1 /target:winexe
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Data,System.Diagnostics,System.Drawin g,System.IO,System.Net,System.Text,System.Windows. Forms
/r:System.dll,System.Data.dll,System.Drawing.dll,Sy stem.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)

--
mikeb
Nov 15 '05 #3

P: n/a
mikeb wrote:
Frank Rizzo wrote:
I have a batch script that is supposed to compile this script:

vbc.exe /main:Form1 /target:winexe
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Data,System.Diagnostics,System.Drawin g,System.IO,System.Net,System.Text,System.Windows. Forms
/r:System.dll,System.Data.dll,System.Drawing.dll,Sy stem.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


Thanks. Step 4 worked for me. BTW, where did you get this info?
Nov 15 '05 #4

P: n/a
Frank Rizzo wrote:
mikeb wrote:
Frank Rizzo wrote:
I have a batch script that is supposed to compile this script:

vbc.exe /main:Form1 /target:winexe
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Data,System.Diagnostics,System.Drawin g,System.IO,System.Net,System.Text,System.Windows. Forms
/r:System.dll,System.Data.dll,System.Drawing.dll,Sy stem.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

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.

--
mikeb
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.