为什么我的ASP.NET Web服务揭开序幕一个过程,但我的.NET控制台应用程序,可以吗? [英] Why can't my ASP.NET web service kick off a process, but my .NET console app can?

查看:109
本文介绍了为什么我的ASP.NET Web服务揭开序幕一个过程,但我的.NET控制台应用程序,可以吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是从一个类库code:

This is code from a class library:


proc.StartInfo = new ProcessStartInfo(CmdPath, "+an -b");
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.WaitForExit();

这完美的作品从一个控制台测试程序调用时我期望的那样。当我采取相同的存储库,它只是挂起。一个ASP .NET Web服务调用的方法

This works perfectly as I would expect when called from a console test app. When I take the same library and call the method from an ASP .NET web service it just hangs.

有我丢失的东西在这里,或许权限?该ASPNET服务就可以访问其中的EXE文件夹,我看到它在任务管理器中运行,虽然它没有做任何事情。

Is there something I am missing here, perhaps permissions? The ASPNET service has access to the folder where the EXE is, and I see it running in Task Manager, though it isn't doing anything.

如果有人能告诉我什么,我做错了,我会AP preciate它。谢谢你。

If anyone could tell me what I'm doing wrong, I would appreciate it. Thanks.

修改:对不起,缺乏信息。 CmdPath进入命令行界面为我们的调度软件。我传递根据他们提供的文件中的命令。我有一个方法来获取的作业列表,以及运行作业的另一种方法。 ...嗯想法。客户端通常使用Active Directory登录,我认为模拟将是必要的。现在要测试一下。

EDIT: Sorry for the lack of information. CmdPath goes to the command line interface for our scheduling software. I'm passing in commands based on the documentation they provided. I have one method to get a list of jobs, and another method to run a job. ...hmm idea. The client normally uses Active Directory to login, I think impersonation is going to be necessary. Going to test now.

编辑2 :好了,现在客户端与AccessViolation问题炸毁。这显然​​是一个权限的事情。如果软件采用集成AD授权,我模仿我的广告帐户,那将是足够的?我使用的web.config中的标签做模拟。

EDIT 2: Ok, now the client is blowing up with AccessViolation issues. This is obviously a permissions thing. If the software uses integrated AD authorization, and I impersonate my AD account, will that be sufficient? I'm doing impersonation using the tag in web.config.

推荐答案

我想你会面临很多的发射使用ASPNET身份可执行的服务器端的问题,你有没有尝试过的假冒的与身份适当priveleges(这并不BTW工作),但再次启动在服务器端的可执行文件可能不是一开始就有一个好主意。

I think you will face a lot of problems launching an executable server side using the ASPNET identity, have you tried impersonating an identity with appropriate priveleges (this does work btw), but again launching an executable on the server side is probably not a good idea to begin with.

这篇关于为什么我的ASP.NET Web服务揭开序幕一个过程,但我的.NET控制台应用程序,可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆