Since this morning I can't run all my .net programs that use the entityframework-v5 to connect to msSqlServer, I pasted the stack error below.
I tried the same files from an other pc on the network, it does work correctly. so I suspected its a windows-update that did the trouble overnight, So I did a system restore, still the same issue.
Now I ran out of ideas.. I don't use oracle, and I don't have any reference to it. and as I said the very same files in the same folder, worked yesterday on my pc, and they also work today from other pc's on the network.
System.BadImageFormatException: Could not load file or assembly 'System.Data.OracleClient.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
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& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.Type.GetType(String typeName)
at System.Data.Common.DbProviderFactories.IncludeFrameworkFactoryClasses(DataTable configDataTable)
at System.Data.Common.DbProviderFactories.Initialize()
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()
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.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
This question indicates that you have installed a 32-bit version of the Oracle Client Components on your machine.
Your stack trace shows the following:
You should either uninstall Oracle Client completely after making sure that no other software depends on it, or additionally install the 64 bit version as stated in the answer linked above.
I don't really have a answer to my problem.. I spent a few days trying to solve it, with no success.
I reinstalled windows altogether, and that fixed the issue.
I really hope it doesn't happen again, installing windows (and reinstall all programs) is not something I want to do frequently...
User contributions licensed under CC BY-SA 3.0