使用单击发布(VS2010)我发布我的Windows应用程序。它是一个非常简单的应用程序,只使用一个第三方库: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应用程序...我应该使用不同的分配方法?
连接字符串在主app.config中。那里没有问题...感觉还有另一个步骤......只是不能把它钉住。第一次Windows应用程序部署在很长一段时间。我一直在做主要的网络应用程序... – Kixoka 2013-04-30 13:32:04
另一件事是确保它没有集成安全性,或者用户有权访问连接到数据库。 – Bearcat9425 2013-04-30 13:35:03
在熊,是啊我不喜欢使用登录,并没有意识到数据库没有设置适当的权限...:p – Kixoka 2013-04-30 14:51:22