使用一键发布(VS2010)我发布了我的 Windows 应用程序。它是一个非常简单的应用程序,只使用一个 3rd 方库:EntityFramework。当它安装并运行时,它会在事件日志中生成以下错误:
Application: HNITPrinterMgtApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Data.EntityException
Stack:
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean, System.Data.Common.DbConnection, System.Data.Common.DbConnection, System.String, System.String, Boolean ByRef)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResults(System.Nullable`1<System.Data.Objects.MergeOption>)
at System.Data.Objects.ObjectQuery`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Data.Entity.Internal.Linq.InternalQuery`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetEnumerator()
at System.Data.Entity.Internal.Linq.InternalSet`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
at HNITPrinterMgtApp.Classes.UiPresenter.GetCurrentListOfPrinters()
at HNITPrinterMgtApp.HNITPrinter.SetFormForTypeOfUser()
at HNITPrinterMgtApp.HNITPrinter.DetermineTypeOfUser()
at HNITPrinterMgtApp.HNITPrinter..ctor()
at HNITPrinterMgtApp.Program.Main()
所有需要的dll都在那里......不太确定我错过了什么......或者我还需要做什么......
如果我将 EF 与我的 Windows 应用程序一起使用...我应该使用不同的分发方法吗?