I am trying to read an xlsx file.
I got exception that
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#
then I installed it from here
http://www.microsoft.com/en-us/download/details.aspx?id=13255
then I changed the platform target to x64
now i got this exception:
BadImageFormatException was unhandeled
{"Could not load file or assembly 'LinqToExcel, Version=1.9.0.0, Culture=neutral, PublicKeyToken=9c8ea65a58f03f1f' or one of its dependencies. An attempt was made to load a program with an incorrect format."}
Update 1
I already installed the linq_to_excel
using
Install-Package LinqToExcel
and then add the lib files to references
You have two options to solve
Enable IIS to run 32 bits app
Install LinqToExcel_x64
if change 32 bit app in iis From false to true,all conflicts about exteltolinq version solve
Please install Microsoft office in your machine it will automatically solve your problem. It worked for me as well.
Related
I have DB2 server that I'm trying to connect from my machine, but I keep getting the below error when I start the application, before even start the connection
System.BadImageFormatException: 'Could not load file or assembly 'IBM.Data.DB2, Version=9.7.4.4, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
please not that I don't have DB2 driver installed on my machine. but I refer to the below libraries in my application, which I got them from DB2 database server.
IBM.Data.DB2;
IBM.Data.DB2.Entity;
IBM.Data.Informix;
Normally the error message is caused by a 32/64 bit conflict.
Your program could be compiled in 64 bit (or any) and the drivers in 32 bit or the other way round.
Check the Configuration Manager and set the Platform to x86 or x64.
When publishing project to windows server 2003 (old test machine) I get following error when trying to call open cv functions.
Additional information: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.Unable to load DLL 'cvextern': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
I am using EmguCV 3.4.1 version with uploaded libraries:
vcruntime140.dll
opencv_ffmpeg341.dll
msvcp140.dll
cvextern.dll
concrt140.dll
To the Emgu package nothing extra (dll's) were added and on developer machine I could develop the application.
I keep wondering whether additional native dll's should be added. I downloaded binaries for 3.4.1 version. The files go like that:
opencv_core249.dll
opencv_highgui249.dll
Those two above where in 3.4.1 package. When i copied them to program directory it didn't help either.
What's more I have no idea how to track down the problem.
Process monitor doesn't show that the process is looking for something that cannot be loaded.
In the inner exception I am given only this exception: Unable to load DLL 'cvextern': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
I had to install "Desktop Experience" feature on my server. Because server 2003 doesn't seem to have it, I had to move it to another server 2008 host.
I'm trying to connect to an IBM message queue using .net and MQ client v8.0.0.5 but I keep receiving the following error:
Fatal error. Failed to initialize XMSFactoryFactory
Could not load file or assembly 'IBM.XMS.Client.Impl, Version=8.0.0.5,
Culture=neutral, PublicKeyToken=d2666ab12fca862b' or one of its
dependencies.
The system cannot find the file
specified.":"IBM.XMS.Client.Impl, Version=8.0.0.5, Culture=neutral,
PublicKeyToken=d2666ab12fca862b
Here's what I've done so far:
Installed MQ Client v8.0.0.5 (x64) on my machine.
Referenced the following assemblies:
amqmdnet.dll
amqmdnsp.dll
amqmdxcs.dll
IBM.XMS.dll
IBM.XMS.Admin.dll
IBM.XMS.Client.Impl.dll
IBM.XMS.NLS.dll
IBM.XMS.Provider.dll
IBM.XMS.Util.dll
Now I also have version v7.5.0.4 installed on my machine and that is having no issues connecting to the queue.
One more thing I noticed is there are no assemblies for v8.0.0.5 in the GAC but the assemblies for v7.5.0.4 are present. Can that be the reason?
Unfortunately, I cannot remove v7.5.0.4 until have both the versions working normally.
Yes, MQ v8.0.0.5 XMS .NET assemblies not being in the GAC is most likely the cause.
You can look at the alternative of using redirection, update app.config file to use the correct version of assemblies your application requires. Look into your MQ installation directory for a file called NonPrimaryRedirect.config. This file contains sample configuration required for application to look for a specific version of MQ/XMS .NET assembly. Copy the contents of this file to your application's app.config file and try. You must ensure all href attributes point to correct path.
I have a project that was built in Visual Studio 2005 in C#. I created an installer for the Windows application (in VS2010) and it installs and works fine on Windows XP SP3. I tried installing it on Windows 7 32-bit and it says installation is successful but when I try to open the application I receive this error message:
A fatal error has occurred. Unable to load DLL 'VistaDb20.dll': Invalid
access to memory location. (Exception from HRESULT: 0x800703E6)
People suggested I run this in the command line:
regsvr32 VistaDb20.dll
I get the error message:
The module "VistaDb20.dll" was loaded but the
entry-point DllRegisterServer was not found.
Make sure that "VistaDb20.dll" is a valid DLL or OCX
file and then try again.
So then I tried regasm VistaDb20.dll /tlb:VistaDb20.tlb using the .NET Framework Assembly Registration Utility 2.0.50727.4927 and get error:
RegAsm : error RA0000 : Failed to load 'VistaDb20.dll' because it is not a valid .NET assembly.
I am not sure how to get my application running on Windows 7 with this .dll problem. Any help would be appreciated. This application and the database was created using VistaDB 2.1
I guess I can't change the actual dll since I did not create it but maybe I have to change some properties of the dll in Visual Studio?
I had this error while trying to registering my VB .NET assembly using RegAsm command:
RegAsm : error RA0000 : Failed to load 'VistaDb20.dll' because it is not a valid .NET assembly.
I solved the problem buy executing RegAsm of the right .NET Framework.
I mean you should use the tools of the same Framework that you make as target in your advanced options of compilation (VS2010).
According to this your problem is that this DLL is not compatible with DEP. You'll need to disable DEP to workaround this but in the long term you should try to wean yourself off this particular dependency.
I have some old 32bit console .NET 2.0 applications that should be migrated to win2008 r2 server.
Note 1: I have one old 32bit application that doesn't load any assembly and is working correctly.
Note 2: When I start one of the applications I get
System.BadImageFormatException Could not load file or assembly error
Note 3:
Each of them are using NLog version 0.9.0.0. When I start these applications on our new server, I get following exception in nLOG.txt:
Error Could not load platform specific extensions: System.NullReferenceException: Object reference not set to an instance of an object.
at NLog.FilterFactory.AddFiltersFromAssembly(Assembly theAssembly, String prefix)
at NLog.Config.XmlLoggingConfiguration.LoadExtensionsFromAssembly(Assembly asm, String prefix)
at NLog.Config.XmlLoggingConfiguration.RegisterPlatformSpecificExtensions(String name)
Can you please help us how to solve this problem? Thank you in advance.
Deveti Putnik
Go to your project settings, and make sure you build your target to 32-bit (x86), and "All Platforms".
The problem you're seeing is a 64-bit executable trying to access a 32-bit DLL. .NET executables by default run as 64-bit on 64-bit OSes.
For point 3:Why not Upgrade NLog to 2.0, For point 2: "System.BadImageFormatException Could not load file or assembly for which assembly" can you find out assemby name causing this problem,it should be there in error message