473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How Do I make Multiple "Entry Points" in a .NET CORE app?

xarzu
88 64KB
I am new to .NET CORE but I have followed a few tutorials. The tutorials I have followed are basically "Hello World" types of programs where I make a small functional .Net Core application and I publish it. They are basically a DLL, I assume, and they run in some sort of system/container where they can run on any OS.

Even though the final product is a DLL, the code itself seems to be structured in a way where it is an actual executable application.

So how would I translate an actual C# DLL project into a .NET Core project? How would a project that is already designed to produce a DLL work in a .Net Core project?

Executables only have one entry point: static void Main.

.NET Libraries expose public methods which are all entry points in that sense.

An "entry point" in a program is where the operating system invokes an executable program file, the term does not apply to libraries. (and ASP.NET web-application files are really just libraries, the ASP.NET host just looks for certain exposed Page/Handler/Controller types). This applies to ASP.NET. Does it also apply to .NET Core? Also, when I ran my .NET Core applications, I did it from a special command line. So how would that work if I translated a DLL C# program into a .NET Core program?
Apr 11 '18 #1
1 1951
Luuk
1,047 Expert 1GB
If you create a Library (a .DLL) like this:
Expand|Select|Wrap|Line Numbers
  1. namespace SharedLibrary
  2. {
  3.     public class myLibrary
  4.     {
  5.         public static string one()
  6.         {
  7.             return "one";
  8.         }
  9.  
  10.         public static string two()
  11.         {
  12.             return "two";
  13.         }
  14.     }
  15. }
  16.  
Than it will habe two entry-point (as you call them);

In a console application you can than to this:
Expand|Select|Wrap|Line Numbers
  1. using SharedLibrary;
  2.  
  3. namespace TestSharedLibrary
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine(SharedLibrary.myLibrary.one());
  10.             Console.WriteLine(SharedLibrary.myLibrary.two());
  11.         }
  12.     }
  13. }
  14.  
This gives as output:
Expand|Select|Wrap|Line Numbers
  1. one
  2. two
Apr 14 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for...
6
by: malv | last post by:
Multiprocessing has been pushed into the field as the chip manufacturers can no longer deliver as they were used to for many years. The general public has been conditioned to believe that 1 + 1 =...
47
by: Mark | last post by:
why doesn't .NET support multiple inheritance? I think it's so silly! Cheers, Mark
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
62
by: robert | last post by:
I'd like to use multiple CPU cores for selected time consuming Python computations (incl. numpy/scipy) in a frictionless manner. Interprocess communication is tedious and out of question, so I...
10
by: Louise Hoffman | last post by:
Dear readers, I was wondering, if Python in the foerseeable future will allocate one CPU core just for the interpreter, so heavy Python operations does slow down the OS? It seams to me like a...
0
by: tanish2k | last post by:
hi. I am using c#, visual studio 2003. I need to validate a xml file against schema which itself has 2 more schema imported under it. i have following 2 xsd files : xsd1 --->...
3
by: Fred | last post by:
We all agree that multi-core is where the industry is headed. Can the .NET framework take advantage of multi-cores? are the programs written in .NET multi-threaded by default or is additional...
6
by: nikhilketkar | last post by:
What are the implications of the Global Interpreter Lock in Python ? Does this mean that Python threads cannot exploit a dual core processor and the only advantage of using threads is in that...
8
by: Andy | last post by:
Hi guys, I'm sorry, I'm not sure this is the correct group to be asking this kind of question... I'm going to develop a software package that includes a web server (and PHP code) , a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.