cancel
Showing results for 
Search instead for 
Did you mean: 

SAP.NET Connector

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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 ...

Former Member
0 Kudos

yes, I have added the dlls in system 32 (mSCVR71.dll nad MSCVP 71.dll) on the production server along with librfc32.dll, still I am getting the same exception.

Former Member
0 Kudos

did you install also the .net 1.1 in your production server

Former Member
0 Kudos

no , without installing will it not be possible , as we have 2.0 framework on the server, it is window 2003 machine

Former Member
0 Kudos

I'm affraid that you have to install also dotnet 1.1

Answers (2)

Answers (2)

Former Member
0 Kudos

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!!!

Former Member
0 Kudos

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?

Former Member
0 Kudos

Yes I am using a 64 -bit hardware(windows server 2003)..

Former Member
0 Kudos

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.

Former Member
0 Kudos

thanks , can u tell me the name of c++ runtime libraries , and also what about the oracle client ( 32 bits? or 64 bits? )

Former Member
0 Kudos

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:

http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&displa...

Also, I would use the comflags tool in VS to ensure that the application is compiled as x86.

Former Member
0 Kudos

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

Former Member
0 Kudos

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://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/13f991a5-45eb-496c-8618-2...

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

there is confusion , i have gone through the articles where we have to make IIS 32 bit, in that case also do we have to compile our asp.net application to X86 ,

and how do we make asp.net 2.0 application to compile as x86, can u tell the exact way or link

Former Member
0 Kudos

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

Former Member
0 Kudos

thanks for all the help, I have compiled my application, but I will need to install a 32 bit oracle client, because when i make my IIS to run 32 bit application , i am getting an oracle error, so I will install a 32 bit oracle client, and hope that will resolve my problem

Former Member
0 Kudos

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.

Former Member
0 Kudos

yes, I will surely tell you the progress, once I install 32 bit client.

thanks