How do you make one dotnet exe talk to another dornet.exe like a dotnet dll?

G

GG

Currently we have clientMail.dll in dot net. All the dot net exes use it
to send e-mail.
However, the above will not work with mcafee 8 unless adding into the
exceptions all the apps exe.
I would like only to make a clientMail.dll to exe so I can only add one
exception to the list

I can add
[STAThread]
public static void Main()
{
}
and conmpile clientMail to exe but the apps do not let me add a
reference to exe even though is build through dot net

Any ideas how to make it work?


Thanks
 
M

MuZZy

GG said:
Currently we have clientMail.dll in dot net. All the dot net exes use it
to send e-mail.
However, the above will not work with mcafee 8 unless adding into the
exceptions all the apps exe.
I would like only to make a clientMail.dll to exe so I can only add one
exception to the list

I can add
[STAThread]
public static void Main()
{
}
and conmpile clientMail to exe but the apps do not let me add a
reference to exe even though is build through dot net

Any ideas how to make it work?

It won't help as clientMail.dll is only used as a dynamic library,
but i'm sure that McAfee is looking for running apps, so even if you make an exe file instead of dll
and use this exe in other exe apps, it will see those apps, not clientMail.

But just for your record you can utilize classes from an exe file with Assembly.* functions and Reflection
 
R

Richard Blewett [DevelopMentor]

You can reference a .exe but not from within Visual Studio. You have to use the command line compiler such as

csc /r:mtexe.exe app.cs

However this will not solve your problem as the .exe assembly will simply be loaded into the process of the other application. You need it to run as a separate process.

I guess you need dll to be autostarted so:
you could repackage the code as a windows service and have it autostart and use remoting to communicate with it.
you could do the same using ASP.NET as a remoting host rather than a service
you could change the code so that the components in question derive from System.EnterpriseServices.ServicedComponent and set the application to be a server one so it loads into a copy of DllHost.exe (of course this will mean having McAffee having to trust all components running under DllHost.exe). Then DCOM will be used as the communication protocol rather than remoting.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Currently we have clientMail.dll in dot net. All the dot net exes use it
to send e-mail.
However, the above will not work with mcafee 8 unless adding into the
exceptions all the apps exe.
I would like only to make a clientMail.dll to exe so I can only add one
exception to the list

I can add
[STAThread]
public static void Main()
{
}
and conmpile clientMail to exe but the apps do not let me add a
reference to exe even though is build through dot net

Any ideas how to make it work?


Thanks






--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.1 - Release Date: 19/01/2005



[microsoft.public.dotnet.languages.csharp]
 
G

GG

I got the dll to run with reflection but still the same problem.
Is there a way to run the dll as a separate process but not through
remoting?

Thanks
 
G

GG

Remoting makes the apps complex and will require more code and more
links for something to break.
I would like to stay away from remoting.

Thanks
 
M

MuZZy

GG said:
I got the dll to run with reflection but still the same problem.
Is there a way to run the dll as a separate process but not through
remoting?

Sorry to disappoint you but it doesn't matter how you invoke your dll's functions.
All that matters is which application calls those classes/functions from your dll -
those apps will be seen by mcafee, not your dll, which is just a "storage", when you call
dll you don't "execute" it, you just request it's methods/classes in simple words.

So, i wouldn't advise you to spend much more time trying to do it the way you wanted.

If you want to achieve your goal, you really need to use this as a separate mailing program,
which will either use remoting or just have a tcp server for talking with other programms,
which is pretty much the same idea.

Good luck,
Andrey
 
G

GG

Think you are right that need a separate application all togetther.
Finally, we decided to relax the Mcafee rule since we had other apps
including sql server that need to send e-mail.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top