C# Webservice不断引用entityframework的旧版本

C# Webservice不断引用entityframework的旧版本,c#,mysql,wcf,web-services,entity-framework,C#,Mysql,Wcf,Web Services,Entity Framework,我有一个.NET 4.5 WCF Web服务,它使用Entityframwork 5.0.0和MySQL connector 6.7.4。 webservice在localhost上运行良好(即使从另一个comupter使用),但当我将其上载到服务器(IIS)时,在尝试使用webservice时出现以下错误: »Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKey

我有一个.NET 4.5 WCF Web服务,它使用Entityframwork 5.0.0和MySQL connector 6.7.4。 webservice在localhost上运行良好(即使从另一个comupter使用),但当我将其上载到服务器(IIS)时,在尝试使用webservice时出现以下错误:

»Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.«
我找不到任何提到EF 4.4.0.0的地方


堆栈跟踪:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">><EventID>131076</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2014-01-15T10:10:45.9384169Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{2db07ea1-945c-4f1b-bd7b-c89c7f34b7d4}" /><Execution ProcessName="w3wp" ProcessID="5772" ThreadID="3" /><Channel /><Computer>SVIZEC</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord Severity="Error" Channel="Operational" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord"><TraceIdentifier>http://msdn.microsoft.com/sl-SI/library/System.ServiceModel.Diagnostics.TraceHandledException.aspx</TraceIdentifier><Description>Handling an exception. Exception details: System.InvalidOperationException: Failed to set Database.DefaultConnectionFactory to an instance of the 'MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity' type as specified in the application configuration. See inner exception for details. ---&gt; System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at System.Data.Entity.Internal.ConfigFile.DefaultConnectionFactoryElement.GetFactoryType()
   at System.Data.Entity.Internal.AppConfig.&lt;.ctor&gt;b__1()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Internal.AppConfig.&lt;.ctor&gt;b__1()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
   at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
  at System.Data.Entity.DbSet`1.Add(TEntity entity)
   at UniFeriBank_Webservice.Database.Dao.DebitCardDao.Create() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\Database\Dao\DebitCardDao.cs:line 121
   at UniFeriBank_Webservice.Service.InvoiceService.Create() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\Service\InvoiceService.cs:line 266
   at UniFeriBank_Webservice.UniFeriBankService.CreateDB() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\UniFeriBankService.cs:line 121
   at SyncInvokeCreateDB(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</Description><AppDomain>/LM/W3SVC/1/ROOT/SOATravel/test-2-130342542452822131</AppDomain><Exception><ExceptionType>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Failed to set Database.DefaultConnectionFactory to an instance of the 'MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity' type as specified in the application configuration. See inner exception for details.</Message><StackTrace>   at System.Data.Entity.Internal.AppConfig.&amp;lt;.ctor&amp;gt;b__1()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
   at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
   at System.Data.Entity.DbSet`1.Add(TEntity entity)
   at UniFeriBank_Webservice.Database.Dao.DebitCardDao.Create() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\Database\Dao\DebitCardDao.cs:line 121
   at UniFeriBank_Webservice.Service.InvoiceService.Create() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\Service\InvoiceService.cs:line 266
   at UniFeriBank_Webservice.UniFeriBankService.CreateDB() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\UniFeriBankService.cs:line 121
   at SyncInvokeCreateDB(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp;amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><ExceptionString>System.InvalidOperationException: Failed to set Database.DefaultConnectionFactory to an instance of the 'MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity' type as specified in the application configuration. See inner exception for details. ---&amp;gt; System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at System.Data.Entity.Internal.ConfigFile.DefaultConnectionFactoryElement.GetFactoryType()
   at System.Data.Entity.Internal.AppConfig.&amp;lt;.ctor&amp;gt;b__1()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Internal.AppConfig.&amp;lt;.ctor&amp;gt;b__1()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
   at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
   at System.Data.Entity.DbSet`1.Add(TEntity entity)
   at UniFeriBank_Webservice.Database.Dao.DebitCardDao.Create() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\Database\Dao\DebitCardDao.cs:line 121
   at UniFeriBank_Webservice.Service.InvoiceService.Create() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\Service\InvoiceService.cs:line 266
   at UniFeriBank_Webservice.UniFeriBankService.CreateDB() in d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank_Webservice\UniFeriBankService.cs:line 121
   at SyncInvokeCreateDB(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp;amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</ExceptionString><InnerException><Exception><ExceptionType>System.IO.FileLoadException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</Message><StackTrace>   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at System.Data.Entity.Internal.ConfigFile.DefaultConnectionFactoryElement.GetFactoryType()
   at System.Data.Entity.Internal.AppConfig.&amp;lt;.ctor&amp;gt;b__1()</StackTrace><ExceptionString>System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp;amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at System.Data.Entity.Internal.ConfigFile.DefaultConnectionFactoryElement.GetFactoryType()
   at System.Data.Entity.Internal.AppConfig.&amp;lt;.ctor&amp;gt;b__1()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
</ExceptionString></Exception></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>
>131076302SVIZEChttp://msdn.microsoft.com/sl-SI/library/System.ServiceModel.Diagnostics.TraceHandledException.aspxHandling 例外。异常详细信息:System.InvalidOperationException:未能将Database.DefaultConnectionFactory设置为应用程序配置中指定的“MySql.Data.Entity.MySqlConnectionFactory,MySql.Data.Entity”类型的实例。有关详细信息,请参阅内部异常。--System.IO.FileLoadException:无法加载文件或程序集“EntityFramework,版本=4.4.0.0,区域性=中性,PublicKeyToken=b77a5c561934e089”或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(来自HRESULT的异常:0x8013100)
位于System.RuntimeTypeHandle.GetTypeByName(字符串名称、布尔throwOnError、布尔ignoreCase、布尔reflectionOnly、StackScrawMarkHandle stackMark、IntPtr pPrivHostBinder、布尔loadTypeFromPartialName、ObjectHandleOnStack类型)
在System.RuntimeTypeHandle.GetTypeByName(字符串名称、布尔throwOnError、布尔ignoreCase、布尔reflectionOnly、StackScrawlMark和stackMark、IntPtr pPrivHostBinder、Boolean loadTypeFromPartialName)
在System.Type.GetType(字符串typeName,布尔throwOnError)
位于System.Data.Entity.Internal.ConfigFile.DefaultConnectionFactoryElement.GetFactoryType()处
位于System.Data.Entity.Internal.AppConfig..ctorb__1()
---内部异常堆栈跟踪的结束---
位于System.Data.Entity.Internal.AppConfig..ctorb__1()
在System.Lazy`1.CreateValue()处
在System.Lazy`1.LazyInitValue()处
在System.Data.Entity.Internal.LazyInternalConnection.Initialize()中
在System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()中
在System.Data.Entity.Internal.LazyInternalContext.InitializeContext()中
位于System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(类型entityType)
位于System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
位于System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
位于System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(操作操作,EntityState新闻状态,对象实体,字符串方法名)
位于System.Data.Entity.Internal.Linq.InternalSet`1.Add(对象实体)
at System.Data.Entity.DbSet`1.Add(TEntity实体)
在d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank\u Webservice\Database\Dao\DebitCardDao.Create()中的UniFeriBank\u Webservice.Database.Dao.DebitCardDao.Create()处:第121行
在d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank\u Webservice\Service\InvoiceService.Create()中的UniFeriBank\u Webservice.Service.InvoiceService.Create()处:第266行
在d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank\u Webservice\UniFeriBankService.CreateDB()中
在SyncInvokeCreateDB(对象,对象[],对象[])
位于System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象实例、对象[]输入、对象[]输出)
位于System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&;rpc)
位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&;rpc)
位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&;rpc)
在System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)/LM/W3SVC/1/ROOT/SoatLevel/test-2-13034254245282131System.InvalidOperationException,mscorlib,版本=4.0.0,区域性=中性,PublicKeyToken=B77A5C561934E089未能将Database.DefaultConnectionFactory设置为应用程序配置中指定的“MySql.Data.Entity.MySqlConnectionFactory,MySql.Data.Entity”类型的实例。有关详细信息,请参见内部异常。位于System.Data.Entity.Internal.AppConfig&;书信电报;。康乐文化署署长;燃气轮机;b__1()
在System.Lazy`1.CreateValue()处
在System.Lazy`1.LazyInitValue()处
在System.Data.Entity.Internal.LazyInternalConnection.Initialize()中
在System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()中
在System.Data.Entity.Internal.LazyInternalContext.InitializeContext()中
位于System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(类型entityType)
位于System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
位于System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
位于System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(操作操作,EntityState新闻状态,对象实体,字符串方法名)
位于System.Data.Entity.Internal.Linq.InternalSet`1.Add(对象实体)
at System.Data.Entity.DbSet`1.Add(TEntity实体)
在d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank\u Webservice\Database\Dao\DebitCardDao.Create()中的UniFeriBank\u Webservice.Database.Dao.DebitCardDao.Create()处:第121行
在d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank\u Webservice\Service\InvoiceService.Create()中的UniFeriBank\u Webservice.Service.InvoiceService.Create()处:第266行
在d:\Študenti\1314\SOA\Projekt\banka2\UniFeriBank\u Webservice\UniFeriBankService.CreateDB()中
在SyncInvokeCreateDB(对象,对象[],对象[])
位于System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象实例、对象[]输入、对象[]和输出)
位于System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&;rpc)
位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&;rpc)
位于System.ServiceModel.Dispatcher.ImmutableDispatcheRuntime.ProcessMessage31(MessageRpc&;rpc)
在System.ServiceModel.Dispatcher.MessageRpc.Process(布尔值isOperationConte