无法加载net_connection_reset

时间:2014-05-15 09:03:02

标签: c# asp.net-mvc-3

在我的本地系统中,应用程序运行正常。当我将文件上传到服务器时,我收到以下错误:

  

无法加载net_err_connection_reset

1 个答案:

答案 0 :(得分:0)

使用以下代码找到丢失的库。

using System.IO;
using System.Reflection;
using System.Text;

try
{
    //The code that causes the error goes here.
}
catch (ReflectionTypeLoadException ex)
{
    StringBuilder sb = new StringBuilder();
    foreach (Exception exSub in ex.LoaderExceptions)
    {
        sb.AppendLine(exSub.Message);
        FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
        if (exFileNotFound != null)
        {                
            if(!string.IsNullOrEmpty(exFileNotFound.FusionLog))
            {
                sb.AppendLine("Fusion Log:");
                sb.AppendLine(exFileNotFound.FusionLog);
            }
        }
        sb.AppendLine();
    }
    string errorMessage = sb.ToString();
    //Display or log the error based on your application.
}