This question already has answers here:
How to use a class from one C# project with another C# project
(11 answers)
Closed 7 years ago.
Environment :
In C#, I have a solution with many project. They were added with *.csproj files.
Problem :
In a project, you can use classes of other files through namespace. However, is there a way to use namespace and classes of another project in the same solution?
In visual studio you should have a "References" area in the Solution Explorer. Right click that and click "Add Reference..."
From here, it's just a matter of locating where you other code is on your machine.
Edit: Here is some additional information on DLLs, in case it helps you.
Related
This question already has an answer here:
Dotpeek recompile decompiled files
(1 answer)
Closed 6 years ago.
I have a c# project that includes a dll which I need to make changes to. So I decompiled it using dotpeek, exported the code and made my changes. Now I need to recompile it to add it back to my project.
The issue is that I am not sure if I am going about this problem the right way. And if I was how would I recompile the code into a dll again?
Sorry about this question but I am new to c# and visual studio but thank you for your help!
You will need to create a new C# project in visual studio, put the decompiled code in the new project and then you can convert the modified decompiled code back to dll which can be referenced in your project.
This question already has answers here:
How to reference a C# Class Library project in Visual Studio 2010?
(2 answers)
Closed 8 years ago.
I am trying to write a page that displays a flow Diagram to the user. I downloaded the Tree Chart Generator from: http://www.codeproject.com/Articles/20508/Tree-Chart-Generator and added the Tree Generator project to my solution. However, when I try to reference TreeGenerator from my code behind, it is not recognized. I am sorry if this is a simplistic question, I am pretty new to .NET development.
Go to your web site project in the Solution Explorer, right click, click Add Reference, and select the project you want to reference. You may need to change to a "Solution" tab depending on your version of Visual Studio. I'm assuming Visual Studio because you didn't provide that detail in your question.
This question already has answers here:
How do you share code between projects/solutions in Visual Studio?
(17 answers)
Closed 8 years ago.
I want to have a file with some enum's and use them in several projects in the same solution.
How could I use the same enums throught projects in the same solution instead of having to copy them into every .cs file?
Im from xcode and obj-c and not very used to Visual Studio c# :(
If you have multiple projects that need to share source code you would create a new project as a class library type. Add the code to that project and then add it as a reference to the other projects that need it. Visual Studio will then handle building and sharing of the code for you.
To use the code in those projects you will have to define the using of the shared project in the C# files that need it.
If you need more detailed instructions. Just let me know.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is it possible to mix .cs (C#) and .fs (F#) files in a single Visual Studio Windows Console Project? (.NET)
I have a c# class library project. What is the best way to get f# files working in the same project?
You can't. You'd need to create these as separate projects. It might however be possible to merge to create a single assembly on build using ILMerge.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Place all output dlls in common directory from Visual Studio
I have a solution which is having 15 projects.
Now i want to compile all these project and save dlls into another location using another console application.
MSBuild or Nant