0

I try to convert cs file to DLL file ..

when I am using Class Library project ... it works and create DLL file when I built the project , but when I create new file , as class file , and built it I don't found new dll file in project folder !! why ?? and when I am using the namespace , that is in the new file , in new project I don't found it .

second , can I convert Any cs file in Any type of project like " Console project " into dll file ?? How ?? I am try to built it but any Dll file created !!

2
  • Are you creating the new class in the same project or a new project? Commented Oct 1, 2010 at 14:03
  • @ w69rdy : in the same ClassLibrary Project Commented Oct 1, 2010 at 14:29

2 Answers 2

1

Your project build type must be 'Class Library' to generate an assembly DLL. All classes inside of a single project will be compiled into a single library. For console applications, if you go to the project's properties under the 'Application' tab, you can change the output type to 'Class Library' from 'Console Application'.

Also, the assembly DLL isn't put directly in the project folder. It goes in the \bin\ folder. For instance, the path will look like: MyProject\bin\Debug\MyProject.dll.

Sign up to request clarification or add additional context in comments.

Comments

1

Each project has one DLL file.

So for example your project has the namespace "Car" and it contains two classes. Class "Engine" and class "Tire. If you build this project into a class library your .dll contains the two classes.

You can load this dll in another project as reference. Now you can use Car.engine and Car.tire.

1 Comment

thanks .. I understood :) the new namespace doesn't appear because it doesn't contain public class ..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.