无法从已发布的解决方案中调用exe [英] Not able to invoke exe from published solution

查看:88
本文介绍了无法从已发布的解决方案中调用exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Need to invoke abc.exe from my 4.5 VS web application which is stored under the path C:XYZ.

The command used for the same is C:\XYZ\abc.exe -PZ:\XYZ\123456

Here Z:\XYZ\123456 is a virtual path and some images are stored inside it.

This abc.exe will render images form virtual path and show the same. This works fine when I run the application but when I publish the solution it is not working.

Here is My code:





string FileName1 = WebConfigurationManager.AppSettings [ FILENAME1\" ]的ToString(); //C:\ XYZ \ abc.exe



string FilePath = WebConfigurationManager.AppSettings [ImageURL]。ToString(); // - PZ:\ XYZ \



ProcessStartInfo TestPS = new ProcessStartInfo();



TestPS.FileName = FileName1;



TestPS.Arguments = FilePath;



Process.Start( TestPS);



任何人分享你的答案



谢谢,



Sathish



string FileName1 = WebConfigurationManager.AppSettings["FileName1"].ToString(); //"C:\XYZ\abc.exe"

string FilePath = WebConfigurationManager.AppSettings["ImageURL"].ToString(); //"-PZ:\XYZ\"

ProcessStartInfo TestPS= new ProcessStartInfo();

TestPS.FileName = FileName1;

TestPS.Arguments = FilePath ;

Process.Start(TestPS);

Anyone share ur answers

Thanks,

Sathish

推荐答案

您的应用程序池用户帐户可能没有权限访问给定文件夹并执行exe。



您可以使用log4net或其他方式使用日志异常。那么你甚至可以在生产环境中找到异常。



如果你确定部署服务器中存在exe文件,然后尝试将应用程序池用户更改为管理员用户之一服务器
your application pool user account may not have privileges to access given folder and excute the exe.

you beter use log exceptions by using log4net or something else. then you can find excepions even in production environments.

if you sure that exe file exist in deployment server and then try by changing application pool user to one of admin user of the server


这篇关于无法从已发布的解决方案中调用exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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