我在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中删除代码块,错误就会消失。你知道这可能是从哪里来的吗?
发布于 2011-12-16 14:59:35
试着把"name=OptionsEntities“换成"OptionsEntities”,可能会对你有帮助。
https://stackoverflow.com/questions/8528747
复制相似问题