Kixoka
Kixoka

Reputation: 1161

Window app crashes

Using one click publishing(VS2010) I publish my windows app. Its a pretty simple application that uses only one 3rd party library: EntityFramework. When it installs and runs it gens the following error in the event log:

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()

All the dll's are there that need to be... Not quite sure what I am missing... or what else I need to do....

If I am using EF with my windows app... should I use a different method of distribution?

Upvotes: 2

Views: 2113

Answers (2)

Bearcat9425
Bearcat9425

Reputation: 1608

One thing to note with EF you need to have the connections strings in your main app.config I know that from using my own class libraries that use EF. Also Possibly check to make sure integrated security is not being used or that the user has access to the database.

Upvotes: 2

Kixoka
Kixoka

Reputation: 1161

Turns out it was a permissions issue. Everything works fine!

Upvotes: 1

Related Questions