R2D2RABEAU

.NET 2.0

Hi I am getting a CS0246 error regarding 2 DLL libraries.
So I tried the following:

csc /target:exe /reference:"C:\Program Files\myFolder\myLib1.dll", "C:\Program Files\myFolder\myLib2.dll" Code.cs

but that does not work either.
Any suggestions

Thank you for your help,



Re: Visual C# Language How to specify DLL library path in CSC command line?

Peter Ritchie

I don't have a problem doing that. Are you sure you're using the full name of the type (including namespace) or have the correct using directive in the CS file






Re: Visual C# Language How to specify DLL library path in CSC command line?

R2D2RABEAU

Hi,

When I use VS2005 to run my project it runs smoothly.

When using the command above, specifying the path of the 2 DLL libraries I get the following errors:



error CS2015: 'c:\Program Files\myFolder\myLib1.dll' is a binary file
instead of a text file
error CS1504: Source file 'c:\Program Files\myFolder\myLib2.dll' could not be opened
('Unspecified error ')






Re: Visual C# Language How to specify DLL library path in CSC command line?

Peter Ritchie

/lib specifies locations to find libraries, use /reference to add a reference to a specific library.






Re: Visual C# Language How to specify DLL library path in CSC command line?

R2D2RABEAU

Hi,

What is the right syntax to do that (referencing 2 libraries at once)

I am asking that because now I am getting the following error message:


: error CS0246: The type or namespace name ' abc' could not be
found (are you missing a using directive or an assembly reference )

In VS2005 all runs ok and I did reference the libraries




Re: Visual C# Language How to specify DLL library path in CSC command line?

Peter Ritchie

csc /reference:library1.dll /reference:library2.dll csfile.cs

If you're getting CS0256 errors you don't have a using directive, or you're not accessing members in that library with the correct full name, or the member you're trying to access is not public.