0
I created a windows application Forms c# . net 4.5, in my development environment works perfectly, but when I put the release in the client environment, give the following error when starting:
Descrição
Stopped working
Assinatura do problema:
Nome do Evento de Problema: CLR20r3
Assinatura do Problema 01: hmb.consplus.ivw.exe
Assinatura do Problema 02: 1.0.0.0
Assinatura do Problema 03: 55e8b96b
Assinatura do Problema 04: System.Data
Assinatura do Problema 05: 4.0.30319.18408
Assinatura do Problema 06: 52311175
Assinatura do Problema 07: 25c0
Assinatura do Problema 08: 27
Assinatura do Problema 09: System.Data.Entity.Core.Entity
Versão do sistema operacional: 6.0.6001.2.1.0.274.10
Identificação da Localidade: 1046
What should I do to solve this problem?
I already uninstalled and installed . net 4.5, but the error persists.
Updating
I performed some tests on the structure of my project, and I realized that the problem is in the configuration file App.config
:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
<connectionStrings>
<add name="CONSPLUSEntities" connectionString="metadata=res://*/CONSPLUS.csdl|res://*/CONSPLUS.ssdl|res://*/CONSPLUS.msl;provider=System.Data.SqlClient;provider connection string="data source=localhost;initial catalog=CALLPLUS_VW;persist security info=True;user id=sa;password=Admin55*;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<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>
The Entity framework model is in another project, and when I remove the reference of that project from the main project, the error no longer occurs.
Versions: .net: 4.5.1; Entity Framework: 6.1.3;
APP.Config - From the E.F project
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For 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>
<connectionStrings>
<add name="CONSPLUSEntities" connectionString="metadata=res://*/CONSPLUS.csdl|res://*/CONSPLUS.ssdl|res://*/CONSPLUS.msl;provider=System.Data.SqlClient;provider connection string="data source=<host>;initial catalog=CALLPLUS_VW;persist security info=True;user id=<id>;password=<senha>;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<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>
What version of Windows?
– Jéf Bueno
Windows server 2008
– Diego Moreno
You are referencing some dll that is not among the patterns of
.net
?– Jéf Bueno
I use Entity Framework 6.1
– Diego Moreno
Take a look in that answer. Maybe this will help you.
– Jéf Bueno
Still, the same mistake continues.
– Diego Moreno
Check which versions of the framework your dependencies are using References > Choose reference > Properties > Runtime Version. Look first of System.Data. Looks like one of your references is trying to use another version of
.net
.– Jéf Bueno