启用HttpUnhandledException后,在路径异常中获取非法字符

时间:2011-12-16 01:18:33

标签: asp.net .net path character

我在Global.asax.cs文件错误陷阱中添加到我的.net应用程序中

 void Application_Error(object sender, EventArgs e)
    {
        HttpUnhandledException httpUnhandledException = new 
        HttpUnhandledException(Server.GetLastError().Message, Server.GetLastError());

  SystemFunctions.SendEmailWithErrors(httpUnhandledException.GetHtmlErrorMessage());
    }

当我运行我的应用程序时,我在下面的Designer.Cs函数中获得了一个非法字符路径异常。

public OptionsEntities() : base("name=OptionsEntities", "OptionsEntities")
    {
        this.ContextOptions.LazyLoadingEnabled = true;
        OnContextCreated();
    }

如果我继续使用该应用程序继续。如果我从Global.asax.cs中删除代码块,则错误消失。关于这可能来自哪里的任何想法?

1 个答案:

答案 0 :(得分:0)

尝试替换“name = Options Entities”,“Options Entities”可能会帮助您