473,412 Members | 4,519 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,412 software developers and data experts.

Having Assembly entrypoint in DLL library

I use two classes to manage the Main() command line (and alot of other stuff)
for my prototyping environment.

I tryed putting the MainClass in a DLL and just having the other class
(which gets modified on a per project basis) as the 'program.cs' file (the
only *.cs file).

I keep getting 'Main() not defined error' even though it was defined via the
DLL reference in the project.

Has anyone created a 'rapid development' environment where the Main()
entrypoint
is NOT in any *.cs file for a console application?
Mar 23 '06 #1
3 7812
vj
I am not sure if this sounds alright.. How can you have a entry point in a
project or file other than the main executable or Dll file?

VJ

"Shawnk" <Sh****@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
I use two classes to manage the Main() command line (and alot of other
stuff)
for my prototyping environment.

I tryed putting the MainClass in a DLL and just having the other class
(which gets modified on a per project basis) as the 'program.cs' file (the
only *.cs file).

I keep getting 'Main() not defined error' even though it was defined via
the
DLL reference in the project.

Has anyone created a 'rapid development' environment where the Main()
entrypoint
is NOT in any *.cs file for a console application?

Mar 23 '06 #2
Simple example - A 'Simple Assembly Platform'.

The 'Platform' decouples the 'Static side effects' of a static Main() entry
point.
So using a singleton pattern as the 'platform driver' (which contains
main()) you
instantiate an 'Assembly Platform' class.

The Main() routine then 'enters' the 'Instance entrypoint()' (no static side
effects).

Use case : I'm a developer. I can 'turn over' the assembly platform as a
'new object class' (ie. just a normal C#class) by just dropping the
'platform' it inherits.
The utility is my 'new class' only has 'static stuff' that is meant to be
static VS being forced to be static from the static Main().

The real gain is using a GOF command pattern based assembly platform (not
the simple platform described above).

With a 'Command Platform' (for rapid development) you just need to define a
command line lexicon and an command execution unit. The lexicon is processed
by the command line processor which binds the command on the command line to
the delegate driven execution unit.

The 'rapid development' point is error logging, exception processing,
command line processing, etc is done by the 'Assembly Platform'. This
'platform' can then be dropped (via dropping the inheritance) and directly
'tied' to the execution unit (a class) as a 'execution unit driver'
(basically a client class).

Furthermore by replacing the inherited platform with a new 'EOP' (Event
Observer Pattern) client interface the 'execution unit driver' can be
automatically bound to the execution unit by a framework specific binder
(class).

In summation the context of an 'Assembly Platform' allows you contain the
main entry point and provide a complete component (ie. assembly)
infrastructure that is library (DLL) based.

On final compile the DLL platform library can be statically replicated in
each component that comes off the line. I would prefer the components thus
generated all shared a single copy of the 'Assembly platform' INCLUDING the
entry point.

So we make a compromise and statically link in the 'platform entry point' (A
DLL) and this in turn brings in (via inheritance) the rest of the 'Assembly
Platform' via your standard shared DLL.

So, I may have chose a poor term for the 'Platform entry point' compiled
module. Perhaps I should have said 'platform entry point' (A static LIB) that
gets compiled into the final component (assembly). The static LIB contains
the Main().

I tryed some approaches to do this but ran into problems when
referencing/linking the static LIB 'Platform entry point' into the VS.NET
2005 project.

Thanks for your response as my answer helps me to articulate the problem
(hopefully) a little better.


"vj" wrote:
I am not sure if this sounds alright.. How can you have a entry point in a
project or file other than the main executable or Dll file?

VJ

"Shawnk" <Sh****@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
I use two classes to manage the Main() command line (and alot of other
stuff)
for my prototyping environment.

I tryed putting the MainClass in a DLL and just having the other class
(which gets modified on a per project basis) as the 'program.cs' file (the
only *.cs file).

I keep getting 'Main() not defined error' even though it was defined via
the
DLL reference in the project.

Has anyone created a 'rapid development' environment where the Main()
entrypoint
is NOT in any *.cs file for a console application?

.

Mar 24 '06 #3
By the way.

The 'execution unit' is what you are really working on.

The command line processing and everything else just lets you drive you
execution unit as if it was a DOS utility.

Then you drive/test/play the execution unit using XML config and batch files.

This complements the unit test envrionment as well as reusing a standardized
component infrastructure (error logging, exception processing).

Finally a variety of assembly platforms exist (stratified on complexity) so
you just avoid 'redoing' stuff (like top level exception catching or command
line processing).

"Shawnk" wrote:
Simple example - A 'Simple Assembly Platform'.

The 'Platform' decouples the 'Static side effects' of a static Main() entry
point.
So using a singleton pattern as the 'platform driver' (which contains
main()) you
instantiate an 'Assembly Platform' class.

The Main() routine then 'enters' the 'Instance entrypoint()' (no static side
effects).

Use case : I'm a developer. I can 'turn over' the assembly platform as a
'new object class' (ie. just a normal C#class) by just dropping the
'platform' it inherits.
The utility is my 'new class' only has 'static stuff' that is meant to be
static VS being forced to be static from the static Main().

The real gain is using a GOF command pattern based assembly platform (not
the simple platform described above).

With a 'Command Platform' (for rapid development) you just need to define a
command line lexicon and an command execution unit. The lexicon is processed
by the command line processor which binds the command on the command line to
the delegate driven execution unit.

The 'rapid development' point is error logging, exception processing,
command line processing, etc is done by the 'Assembly Platform'. This
'platform' can then be dropped (via dropping the inheritance) and directly
'tied' to the execution unit (a class) as a 'execution unit driver'
(basically a client class).

Furthermore by replacing the inherited platform with a new 'EOP' (Event
Observer Pattern) client interface the 'execution unit driver' can be
automatically bound to the execution unit by a framework specific binder
(class).

In summation the context of an 'Assembly Platform' allows you contain the
main entry point and provide a complete component (ie. assembly)
infrastructure that is library (DLL) based.

On final compile the DLL platform library can be statically replicated in
each component that comes off the line. I would prefer the components thus
generated all shared a single copy of the 'Assembly platform' INCLUDING the
entry point.

So we make a compromise and statically link in the 'platform entry point' (A
DLL) and this in turn brings in (via inheritance) the rest of the 'Assembly
Platform' via your standard shared DLL.

So, I may have chose a poor term for the 'Platform entry point' compiled
module. Perhaps I should have said 'platform entry point' (A static LIB) that
gets compiled into the final component (assembly). The static LIB contains
the Main().

I tryed some approaches to do this but ran into problems when
referencing/linking the static LIB 'Platform entry point' into the VS.NET
2005 project.

Thanks for your response as my answer helps me to articulate the problem
(hopefully) a little better.


"vj" wrote:
I am not sure if this sounds alright.. How can you have a entry point in a
project or file other than the main executable or Dll file?

VJ

"Shawnk" <Sh****@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
I use two classes to manage the Main() command line (and alot of other
stuff)
for my prototyping environment.

I tryed putting the MainClass in a DLL and just having the other class
(which gets modified on a per project basis) as the 'program.cs' file (the
only *.cs file).

I keep getting 'Main() not defined error' even though it was defined via
the
DLL reference in the project.

Has anyone created a 'rapid development' environment where the Main()
entrypoint
is NOT in any *.cs file for a console application?

.

Mar 24 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Outshined | last post by:
I have a class library where just about every class uses its static initializer to register with a central registry object in the same assembly. I am hoping for some sort of Assembly.Load event...
4
by: Daniel Reber | last post by:
I have an exe that serializes one of it's classes to disk. I also have the exact same .cs file that contains the class that was serialized, in a Windows service application. I am trying to load...
0
by: Steve Richter | last post by:
I have moved a user control from my asp.net web application project into a separate assembly. Where I had registered the control this way: <%@ Register TagPrefix="ac" TagName="ArticleSummary"...
7
by: Alexander van Doormalen | last post by:
Is it possible to load data from a configuration file within a assembly (class library)? The hosting exe file is something completely different which isn't gonna load my config file. I already...
4
by: Rainer Queck | last post by:
Hello NG, I started to build me a little class library. This library I added to a Project which also surves me to test the library. This library holds a namespace: namespace <myLib>.<some...
1
by: divya | last post by:
Hi, I made an assembly (class library project) in Dot net and wanted the assembly to have COM interoperability successfully got the assembly working with VB6 performing following steps: 1.Create...
2
by: =?Utf-8?B?am1hZ2FyYW0=?= | last post by:
i've been tearing my hair out over this for hours. i can reference a C++ library from my C# code on my dev machine, but when i copy the entire Debug directory to another computer my code fails,...
2
by: =?Utf-8?B?U2hlaWxh?= | last post by:
Hi, Does anybody encounter this error: Unhandled Exception: System.IO.FileLoadException: could not load file or assembly or one of its dependencies. Access is denied. I google the error and...
5
by: Christiano Donke | last post by:
Plz.. I intend to share a class library though network. This library is gonna be called by a VB6 project. I've found out that a late file-based binding on vb6 is the easiest way to bind it......
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.