Compiling dll files

aewarnick

Senior Contributor
Joined
Jan 29, 2003
Messages
1,031
I need help to compile a dll file for my class- Andrew.

Help is not much help in VS. It says to type

csc /target:library /out:ProgramAW.dll Andrew.cs

but Here is the error message I get when I press enter:
 

Attachments

You need to add the .NET Framework directory to the global PATH variable in Windows. Either that, or be forced into typing out the full path to csc.exe all the time.

Right click on My Computer and select Properties. Click the Advanced tab and hit the Environment Variables button. Append the location of the .NET Framework folder to the end of the PATH variable (either will do). Make sure to delimit it with a semicolon.

The .NET framework path should look like the following:
C:\%WINDOWSDIR%\Microsoft.NET\Framework\v1.0.3705
 
Here is what is in the system variables path section:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705

I put the last one in but I am still having the same problem. I guess I don't understand the concept of what I am doing.

I also tried putting this:

"C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\csc.exe" /target:library /out:ProgramAW.dll Andrew.cs

in the command window but that does not work either. What could I be doing wrong? I have looked in help for hours now and have not found really any help at all!
 
Last edited:
It looks like you're trying to use the command window in VS. You should be using the Windows command line. Open it by going to start, run and typing cmd. Then you have to navigate to your code directory and run the csc command, providing you've added the directories to your path as Derek said.
 
Ok, that worked. But now how do I make a reference (using) to my dll when it is in the framework version folder with all the other libraries? The compiler or VS does not find it.
 
I got it working but I had to set the copy local property to true. I don't think I should have to do that. I saved it as ProgramAW.dll and the namespace is ProgramAW class Andrew.

If I have copy local set to false I have to write ProgramAW.Andrew all throughout my code and I cannot do that. Is there any way to fix this?
 
Back
Top