我构建了一个winfom桌面应用程序(Visual Studio 2013,c#,Mssql,Entity framework 6)。 如果我在VS2013中测试应用程序运行正常,但我制作installshield包并安装它。删除此例外:
Application: myprog.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateValue()
at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].LazyInitValue()
at System.Lazy`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Value()
at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.GetConfiguration()
at System.Data.Entity.DbContext.InitializeLazyInternalContext(System.Data.Entity.Internal.IInternalConnection, System.Data.Entity.Infrastructure.DbCompiledModel)
at System.Data.Entity.DbContext..ctor(System.String)
at myprog.Form1..ctor()
at myprog.Program.Main()
导致这个?
未生成的代码是all,而不是drop exception:
try
{
src.DataSource = valinor.vats.Select(m => m).ToList();
vatGridControl.DataSource = src;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}