简体   繁体   English

System.Diagnostics.Process.Start在服务器上引发线程异常异常

[英]System.Diagnostics.Process.Start throwing threadabort exception on server

In my website I am using System.Diagnostics.Process.Start to preview a particular file. 在我的网站上,我正在使用System.Diagnostics.Process.Start预览特定文件。 It is working fine on the local server but, it throws ThreadAbortException on the online server when I try to preview the file. 它在本地服务器上运行良好,但是当我尝试预览文件时,它将在联机服务器上引发ThreadAbortException。

The preview of the happens on button click of repeater. 预览事件发生在转发器的按钮单击上。 The code is given below: 代码如下:

if (e.CommandName == "Preview")
            {
                Button btn = (Button)e.CommandSource;
                string filePath = Server.MapPath("~/Upload");
                string _DownloadableProductFileName = filename;
                System.Diagnostics.Process.Start(filePath + "\\" + _DownloadableProductFileName);
            }

To use Process on the ASP.NET server you need to configure the application for Full Trust. 要在ASP.NET服务器上使用Process,您需要为完全信任配置应用程序。

Are you sure you need to spawn this process server side? 您确定需要在此进程服务器端生成吗? It seems you aren't using its output. 看来您没有使用它的输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM