Answer the question
In order to leave comments, you need to log in
How to connect your dll library in C# when working from the console?
C#. I work through the console (compilation). Visual Studio is not installed.
I compiled my class library into a dll file.
Then I created a main program file with a Main method. Dll file and program file are in the same folder. I wrote "using MyDll" in the main program. However, the program does not see my library.
Tell me, with what command in the console can I connect the dll file to my project?
Thank you!
Answer the question
In order to leave comments, you need to log in
shared1.cs
public class MyShared {
public static string getHello() => "Hello, World";
}
prog.csclass MyProgram {
static void Main(string[] args) => System.Console.WriteLine(MyShared.getHello());
}
csc /t:library shared1.cs
csc /t:exe /r:shared1.dll prog.cs
Install studio or teach https://metanit.com/sharp/tutorial/1.3.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question