Command line app won't write when run from ASP

P

Phil

I've made a command line app. two in fact. one in dotnet and the other
vb6 to see if that made a dif. The commandline app writes to a file.
this works fine when I run it from windows. If I run it from my ASP.NET
Web app e.g.:

Dim oWShell


oWShell = CreateObject("WScript.Shell")
oWShell.Run("C:\JaXpeak\app.exe arg1 arg2", 1, True)

And it creates the file , but fails to write anything in it.

Please help, I'm going nuts.

I'm sure its a permissions thing, but what I have no idea. Tried lots
of faffing in the .NET Framwork admin. Given all relevant directories
read and write access for web users. Even given Everthing fulltrust.

Please help.
 
R

Robbe Morris [C# MVP]

If you made the app, why didn't you write the error to the event log
so you'd know exactly what the issue is. It is undoubtedly
a permissions issue. It could be the folder to write to,
could be permission to run the app, or a permission
to use something you've referenced.

Typically, people would write the relevant business logic
in its own assembly that could either be called directly
in the web app or the console app.

The notion that you are purposely triggering a console
app confuses me. I can only assume that you want to
fire and forget. Wouldn't a windows service that
reacts to messages in a message queue be a
more stable implementation of this?
 
P

Phil

Thanks for the reply Robbe

Re a windows service, quite prob, but as I installed .NET for the first
time this week - so I've got a lot to learn. I'll look in to it.

Got any handy hints for starting to look at "messages in message
queues"?

Would be very greatful.

I would still like to know how to get this woking though (just so I
know). How do I set permissions for things I referance (I think that
might be the prob)?

Cheers,
Phil
 
R

Robbe Morris [C# MVP]

First things first, log the error message in your console
app to the event log so you can find out what the
real error is.

Here is a code sample that works with message queues

http://www.eggheadcafe.com/articles/20021221.asp

You'll see how easy it would be to write a message
to the queue with your ASP.NET app and then have
some other external app poll the queue to get what
it needs to trigger the job.
 
P

Phil

again thanks for the help.

1) Don't know how to send the error.

2) I'm a VB guy and so your messaging example isn't much help (thanks
for posting it though)

So how do I get the error message from my .NET console app.? It returns
some errors (I've seen it do this when building it), but it doesn't
seem to throw any when it fails to write. Anyway I'm now concerned that
it is the ActiveX I'm calling via the console app that fails. This is,
I think, due to permissions. So how do I set permissions for
dependancies like referanced dlls (which haven't been made in .NET)?

Cheers
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top