Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

C#
  • *Gurus*
Posted

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

Posted (edited)

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!

Edited by aewarnick
C#
  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted
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.
C#
Posted

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?

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...