c# - My WPF/EntityFramework application don't work on other computer (Resolved) -


i have created wpf application uses entity framework/code first on localdb (i have created database on "model" directory , seems fine).

it works pretty on laptop , wanted share friend doesn't work. think have sql error on other computer doesn't show it. shows windows application error... think it's when try load database context.

my database context :

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.data.entity;  namespace modernuinavigationapp1.model {     class supcontext : dbcontext      {         public dbset<infosconnexion> infosconnexions { get; set; }         public dbset<infosfichiers> infosfiles { get; set; }         public dbset<log> logs { get; set; }     } } 

my app.config :

<?xml version="1.0" encoding="utf-8"?> <configuration>   <configsections>     <!-- more information on entity framework configuration, visit http://go.microsoft.com/fwlink/?linkid=237468 -->     <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" />   </configsections>   <entityframework>     <defaultconnectionfactory type="system.data.entity.infrastructure.localdbconnectionfactory, entityframework">       <parameters>         <parameter value="mssqllocaldb" />       </parameters>     </defaultconnectionfactory>     <providers>       <provider invariantname="system.data.sqlclient" type="system.data.entity.sqlserver.sqlproviderservices, entityframework.sqlserver" />     </providers>   </entityframework> </configuration> 

edit :

the localdb installed, can build , run new entity framework solution on every computers , see localdb on server explorer (on visual studio) each. on solution (the 1 try share) on other computer, have delete app.config, delete , re-import entity framework, , enable migration , update db on console , works, not right/better solution think.

edit 2 (temporary solution, see comments):

i have found solution : if open existing visual studio solution entity framework (and localdb) other computer, have delete entity framework solution right click on solution (on solution explorer in visual studio), choose packet manager, remove entity framework , install again (also in packet manager). generate new app.config correct lines configuration , should works !


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -