Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Launching windows applications from ASP.Net code
sburton
#1 Posted : Wednesday, November 14, 2007 5:59:50 AM(UTC)
Groups: Member
Joined: 11/14/2007(UTC)
Posts: 1

I have a need to launch a Win32 application from my ASP.Net application. Normally this is a problem, because a server can't cause an application to launch on a client without using an ActiveX pluggin or something or that sort. However, because UltiDev will be running on the local computer, the server and the client are the same machine, so I can achieve what I need by having the application start on the "server."

I am using System.Diagnostics.Process.Start() to launch a my application (and for testing purposes this can simply be notepad.exe). When I call this method, the application is launched in the background (it shows up in the task manager under processes but doesn't become visible to the user). It runs under the System account.

I found that Microsoft has documented similar behavior with IIS: http://support.microsoft.com/kb/555134

In their resolution steps they say to go into the services manager, open the service properties, select the Log On tab, and click "Allow service to interact with desktop." They say this allows the IIS service to accomplish what I'm looking for.

When I try this on the Ultidev service and restart the service it won't start again. It gives the error:

"Could not start the UltiDev Cassini Web Server for ASP.NET 2.0 service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion."

So my question is either:

Is there a better way that I can effectively launch a desktop Win32 application via my Asp.Net app with cassini? (Using an ActiveX pluggin in the browser or similar solution is not acceptable)

or

Is there a resolution to get the UltiDev service to start with the interact with desktop box checked?

Thanks,

Scott

Ultidev Team
#2 Posted : Wednesday, November 14, 2007 6:21:20 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Scott,

you should be able to accomplish what you need if you run UltiDev Cassini Server as a regular command-line program. Same UltiDev Cassini server EXE can be run not only as a service, but also as a regular program. That will put the whole process hosting your application under currently logged in interactive user, which should make Process.Start() work. Use /run option of the UltiDevCassinWebServer2.exe, which located in "%ProgramFiles%\UltiDev\Cassini Web Server for ASP.NET 2.0" folder.

You can also consider using "embedded web server" approach, which does not require installing Cassini. You could package your application as a EXE deployed by XCOPY. This approach has limitations - it does not work well on Vista, but on XP it seems to work fine. This way you would also launch UltiDev Cassini as a regular (non-service) program in the current user security context.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.