running application in asp.net process.

  • Thread starter Thread starter Anders Both
  • Start date Start date
A

Anders Both

I want to run a application (console or window) in the asp.net process,
because i need an running application on the server that can acces the same
data/singleton object as my asp.net application.

Does someone know how i can achive this thing, if it is not posible in any
way to open a window form in the asp.net process. How can I then solve this
problem.

Best Regards

Anders Both, Denmark
 
shell out to the command process using ProcessInfo.Start static method

ProcessStartInfo psi = new ProcessStartInfo("notepad.exe");
psi.WindowStyle = ProcessWindowStyle.Hidden;

Process p = new Process();
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(MyExited);
p.StartInfo = psi;
p.Start();

..... do stuff ...

p.Kill(); // Try killing the process

private void MyExited(object sender, EventArgs e)
{
MessageBox.Show("Exited process");
}
 
you can not open a window from a asp.net process. just supply a webservice
that can access your data, and a console or window app can call/pool the
webservice.
 
Since it's not possible, why don't you describe what your business
requirements are, so we can help you think of an alternative design?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Thx, for the reply´s. I need it because i want to have a tcp-service-program
running in my asp.net process. But ofcause i can maybe make it without a
visible interface (or with a web-interface). If I can use Asynchronous
Socket's from within the asp.net process. I will try it out now.

Can I make some setting causing the asp.net to start some code, (call a
method) when asp.net starts up ?

Thx.

p.s. I can not use the ".exe solution" for anything. Because this will just
start a new process.

p.p.s. I think that a web-service or .NET remoting solution will be far to
dificult to make, it would make my hole system much more complicated.

p.p.p.s If it shows up that it is not posible to make an Asynchronous
Socket's from within the asp.net process as well, i will think that asp.net
is not so cool anyway.
 
It´s me the ask´er again.

I found out that there seems to be no problem´s using sockets from the
asp.net process. So my solution will just be to make my applikation without
any Visual Interface, or maybe with a web interface.

How does i Run some special start up code, everytime the asp.net process
start´s ?
 
Back
Top