Tools, FAQ, Tutorials:
"MyLibApp.cs" - Call VC# Class from Library
How to call a function from a VC# class provided in a library?
✍: FYIcenter.com
If you want to call a function from a VC# class provided in a library,
you can follow this tutorial:
1. Reference the shared function with the class name prefix:
MyLib.PrintHello();
2. See the following full source code example, MyLibApp.cs:
// MyLibApp.cs // Copyright (c) FYIcenter.com using fyi; namespace fyi { public class MyLibApp { static void Main(string[] args) { MyLib.PrintHello(); } } }
3. Compile the code with the "csc /reference" command:
\fyicenter>csc /reference:MyLib.dll MyLibApp.cs Microsoft (R) Visual C# Compiler version 2.2.0.61624 Copyright (C) Microsoft Corporation. All rights reserved. >dir MyLibApp.* 09:23 AM 203 MyLibApp.cs 09:23 AM 3,584 MyLibApp.exe
4. Run the executable code:
C:\fyicenter>MyLibApp.exe Hello world! - From MyLib
Â
⇒First Visual C# Program in Visual Studio 2017
⇒⇒Visual Studio Tutorials
2017-08-06, 1888👍, 0💬
Popular Posts:
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How To Protect Special Characters in Query String in PHP? If you want to include special characters ...
How to use the "@(...)" expression in Azure API Policy? The "@(...)" expression in Azure API Policy ...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How to use the RSS Online Validator at w3.org? You can follow this tutorial to learn how to use the ...