on 01-28-2009 7:27 AM
Hi,
I have created an application in framework 1.1 using Sap.net connector , and used this dll in an application(ASP.NET) made in framework 2.0, now when I deploy this application(made in 2.0) on production server , I am getting an exception "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" Please give a solution for this problem
thanks
Puneeta
Did you add also the 2 dll needed provided by the sap.net connector in your reference when you build your DLL on VS 2003 ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Para que funcione SAP Connector en un ambiente de 64 bits seguir los siguientes pasos:
1.- Dirigirse a las propiedades del proyecto que esten desarrollando (usumimos que ya hemos generado la conexión a SAP con .NET 2003 con Framework 1.1)
2.- Luego en la sección "Build" de nuestro proyecto ubicamos la opción "Platform target" y escogemos "x86"
3.- Asumimos que contamos con las siguientes dll traidas desde la carpeta c:WindowsSystem32 de nuestro ambiente de 32bits: librfc32.dll, msvcp71.dll, msvcr71.dll, SAP.Connector.dll y SAP.Conector.Rfc.dll
4.- Copiar el archivo librfc32.dll hacia la siguiente ruta C:WINDOWSsystem
5.- Copiar el archivo msvcp71.dll hacia la siguiente ruta C:WINDOWSsystem32
6.- Copiar los archivos msvcp71.dll y msvcr71.dll hacia la siguiente ruta C:WINDOWSSysWOW64
7.- Arrastrar los archivos SAP.Connector.dll y SAP.Conector.Rfc.dll hacia la siguiente ruta C:WINDOWSassembly
Si fuera necesario descarguense antes el "Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)" desde la pagina de microsoft, este archivo contiene dlls necesarias para un ambiente donde no se tiene instalado VS 2008.
Con eso me funcionó sin ningun problema.
Compartanlo!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You DO NOT need to install framework 1.1. Once you compile your application in 2.0, your okay.
Your issue here is missing C++ runtime files.
Are you are running on 64 bit hardware?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Puneeta,
Here's a high-level sequence you need to follow to get the .NET connector working on x64:
1 - Build your proxy in VS 2003.
2 - Import the .dll from step 1 into your VS 2005/2008 project.
3 - Compile your application as x86.
4 - Deploy you application, make sure you include the two .dll files the .NET connector requires.
5 - Make sure the C++ runtime libraries are installed on your server.
From your email, I believe you may be missing the C++ runtime libraries. You can download these files from Microsoft.
Please post any errors you receive here and I'll do my best to respond.
I"m not familiar with the Oracle client but I would run the 32-bit version if it interacts in any way with the application that you are using the .net connector in.
You can download the libraries here:
Also, I would use the comflags tool in VS to ensure that the application is compiled as x86.
I am using a 64 bit OS,64 bit Oracle Client ,64 bit asp.net 2.0(x64),
when my application call the page made in asp.net 1.1 it gives the BADIMAGE Exception....(sap.net connector),
I have copied the c++ runtime files , one thing more you said the application is to be complied as x86 , which application ?? the application made in asp.net 1.1, I compiled it using corflags.exe ,still the problem occurs,
I have read somewhere that I need to make settings for IIS to 32 bit, with this I installed 1.1 framework on my server along with 2.0 , but again I get the error this time for ORACLE Client.... need a proper method
Edited by: Puneeta Parnami on Feb 3, 2009 1:34 PM
The high-level answer is your need to run all components in 32 bit mode, including IIS. Have a look at these 2 articles and ensure IIS is running in 32 bit mode:
http://support.microsoft.com/kb/894435
The .NET version should not be an issue. The error you are receiving is due to the 32 vs. 64 bit issue.
I compiled the proxy in vs 2003 and then imported it into vs 2008. I then compiled the project targeting x86 and .NET 2.0.
Can you please post the results of corflags for your web app assemblies? If you run corflags.exe <assembly name>, you should get the current settings.
how to complie the webapplication made in 2.0 , using corflags.exe,? x86 ? this is not clear, as there is not one dll that is made when we complie a dot net project in 2.0 ..please clear it,
i have complied the asp.net 1.1 class library project as x86 using corflags.exe , i will post u the result
When you compile your 2.0 app in vs 2005 or 2008, you have a setting to compile for "AnyCPU" or to target "x86". You need to make sure the setting your are using is "x86". Furthermore, the resulting assembly should be checked using the corflags tool to ensure that the "32BIT" settings is set to "1" (on).
See this post for additional information on the differences between the three settings. Pay close attendtion to the section titled "On a 64-bit x64 machine". It describes the problem you are facing... the "Bad Image".
http://blogs.msdn.com/joshwil/archive/2005/04/08/406567.aspx
The 1.1 proxy assembly is fine. You need to look at the 2.0 application.
If you need additional help, please describe your environment in more detail, specifically, describe the makeup of the 2.0 app.
Once you are sure that the "32BIT" flag is set to "1", your problem should be resolved.
Please award point if this solution works for you.
In order to compile the 2.0 app and target x86, please follow this MS article:
http://support.microsoft.com/kb/967163
Here's a brief overview on how to do this:
To set this compiler option in the Visual Studio development environment
1.Open the Properties page for the project.
2.Click the Build property page.
3.Modify the Platform target property (default is "anycpu" change it to "x86").
Follow the links within the article and they will guide you, step-by-step, on how to target x86 from VS.
In addition, please check the resulting assembly or assemblies from the above step to ensure the 32 bit flag is set. If you want, you can send me the assembly or assemblies after you follow the above procedures and compile them as x86. I can check them and let you know if they are okay or not.
Edited by: Efrain Fuentes on Feb 4, 2009 7:28 PM
Yes, you definitely need the 32 bit client. As long as you have compiled your 2.0 app in x86 mode, you should be okay.
I'm in the process of writing a step-by-step guide to deploying the .NET connector on x64. More and more organizations are moving to x64 architecture so hopefully it will help them out.
Let me know if you run into any more issues after you install the Oracle 32 bit client.
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.