Connecting Tech Pros Worldwide Forums | Help | Site Map

how to add vc unmanaged dll to asp.net web site

Volodia
Guest
 
Posts: n/a
#1: May 30 '07
Hi,

I have a problem to find information how to add unmanaged dll
build in VC++ 2005 to the asp.net web site

What I have tried:
1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
2. put MyDll.dll into Bin folder for ASP.Net web site

But unfortunately an exception has been thrown

Unable to load DLL 'MyDll.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E).

Thank you,

Volodia.



bruce barker
Guest
 
Posts: n/a
#2: May 30 '07

re: how to add vc unmanaged dll to asp.net web site


your vc++ dll is probably dependent on another dll that is not also in
bin or system32 dir (vc++ runtime?)

-- bruce (sqlwork.com)

Volodia wrote:
Quote:
Hi,
>
I have a problem to find information how to add unmanaged dll
build in VC++ 2005 to the asp.net web site
>
What I have tried:
1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
2. put MyDll.dll into Bin folder for ASP.Net web site
>
But unfortunately an exception has been thrown
>
Unable to load DLL 'MyDll.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E).
>
Thank you,
>
Volodia.
>
>
Volodia
Guest
 
Posts: n/a
#3: May 30 '07

re: how to add vc unmanaged dll to asp.net web site


List of dependancies looks ok:
ADVAPI32.DLL
KERNEL32.DLL
NTDLL.DLL
RPCRT4.DLL

Thank you,
Volodia

"bruce barker" <nospam@nospam.comwrote in message
news:OTpnX8soHHA.4424@TK2MSFTNGP03.phx.gbl...
Quote:
your vc++ dll is probably dependent on another dll that is not also in bin
or system32 dir (vc++ runtime?)
>
-- bruce (sqlwork.com)
>
Volodia wrote:
Quote:
>Hi,
>>
>I have a problem to find information how to add unmanaged dll
>build in VC++ 2005 to the asp.net web site
>>
>What I have tried:
>1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
>2. put MyDll.dll into Bin folder for ASP.Net web site
>>
>But unfortunately an exception has been thrown
>>
>Unable to load DLL 'MyDll.dll': The specified module could not be found.
>(Exception from HRESULT: 0x8007007E).
>>
>Thank you,
>>
>Volodia.

Volodia
Guest
 
Posts: n/a
#4: Jun 1 '07

re: how to add vc unmanaged dll to asp.net web site


I have done this by creating proxy managed dll:

1. creating managed dll
2. Creating inside managed dll class with code that reference
DllImport("MyDll.dll")
3. copy managed dll and unmanaged MyDll.dll into BIN folder
4. call in asp.net managed dll

Thanks,
Volodia.

"Volodia" <GROUNDSOFT@hotmail.comwrote in message
news:O6iKmzqoHHA.4124@TK2MSFTNGP02.phx.gbl...
Quote:
Hi,
>
I have a problem to find information how to add unmanaged dll
build in VC++ 2005 to the asp.net web site
>
What I have tried:
1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
2. put MyDll.dll into Bin folder for ASP.Net web site
>
But unfortunately an exception has been thrown
>
Unable to load DLL 'MyDll.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E).
>
Thank you,
>
Volodia.
>

Volodia
Guest
 
Posts: n/a
#5: Jun 6 '07

re: how to add vc unmanaged dll to asp.net web site


I have done this by creating proxy managed dll
Below steps I have used:

1. Start new Class Library project
2. Add unmanaged dll exported function description
[DllImport("MyDll.dll")]
private static extern int getprivatekey(StringBuilder bufUserName,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder bufUserKey);
3. Add new function in my class
public static string GetUserKey(string sUserName)
4. place both managed dll and unmanaged MyDll.dll into BIN folder
5. call in asp.net managed dll

Thanks,
Volodia.

"Volodia" <GROUNDSOFT@hotmail.comwrote in message
news:O6iKmzqoHHA.4124@TK2MSFTNGP02.phx.gbl...
Quote:
Hi,
>
I have a problem to find information how to add unmanaged dll
build in VC++ 2005 to the asp.net web site
>
What I have tried:
1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
2. put MyDll.dll into Bin folder for ASP.Net web site
>
But unfortunately an exception has been thrown
>
Unable to load DLL 'MyDll.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E).
>
Thank you,
>
Volodia.
>

=?Utf-8?B?cG9zdGVh?=
Guest
 
Posts: n/a
#6: Jun 20 '07

re: how to add vc unmanaged dll to asp.net web site




"Volodia" wrote:
Quote:
I have done this by creating proxy managed dll
Below steps I have used:
>
1. Start new Class Library project
2. Add unmanaged dll exported function description
[DllImport("MyDll.dll")]
private static extern int getprivatekey(StringBuilder bufUserName,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder bufUserKey);
3. Add new function in my class
public static string GetUserKey(string sUserName)
4. place both managed dll and unmanaged MyDll.dll into BIN folder
5. call in asp.net managed dll
>
Thanks,
Volodia.
>
"Volodia" <GROUNDSOFT@hotmail.comwrote in message
news:O6iKmzqoHHA.4124@TK2MSFTNGP02.phx.gbl...
Quote:
Hi,

I have a problem to find information how to add unmanaged dll
build in VC++ 2005 to the asp.net web site

What I have tried:
1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
2. put MyDll.dll into Bin folder for ASP.Net web site

But unfortunately an exception has been thrown

Unable to load DLL 'MyDll.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E).

Thank you,

Volodia.
>
>
>
=?Utf-8?B?cG9zdGVh?=
Guest
 
Posts: n/a
#7: Jun 20 '07

re: how to add vc unmanaged dll to asp.net web site


"postea" wrote:

I have a similar problem and see all over that for years many people have
such a problem, but I cannot find anyone who explains how to solve it, so i
hope someone can help me.

I get the exception message:
Unable to load DLL 'shapelib.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)

This is one of two external third-party non-ASP.NET DLLs I reference in my
ASP.NET 2.0 application. This application works fine when installed on a
webserver sunning a personal operating system Windows XP 2005. However, if I
install the application on a webserver with Webserver 2003 operating system
it gives me this "Exception from HRESULT: 0x8007007E)" error. I know exactly
that it is these 2 external DLLs it can't find. However, they are
automatically installed in the bin directory when I publish the web
application (I don't have to copy them manually or anything - Visual Studio
knows they are needed and copies them), which is the same directory as my
ASP.NET 2.0 dlls that reference these 2 DLLs, but it can't find them on
Webserver 2003 OS, but works fine on XP.

Please can someone tell me what I have to do on a webserver with WebServer
2003 OS to make it work>

Thanks
Quote:
>
>
"Volodia" wrote:
>
Quote:
I have done this by creating proxy managed dll
Below steps I have used:

1. Start new Class Library project
2. Add unmanaged dll exported function description
[DllImport("MyDll.dll")]
private static extern int getprivatekey(StringBuilder bufUserName,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder bufUserKey);
3. Add new function in my class
public static string GetUserKey(string sUserName)
4. place both managed dll and unmanaged MyDll.dll into BIN folder
5. call in asp.net managed dll

Thanks,
Volodia.

"Volodia" <GROUNDSOFT@hotmail.comwrote in message
news:O6iKmzqoHHA.4124@TK2MSFTNGP02.phx.gbl...
Quote:
Hi,
>
I have a problem to find information how to add unmanaged dll
build in VC++ 2005 to the asp.net web site
>
What I have tried:
1. use DllImport("MyDll.dll") to declare function in mypage.aspx.cs
2. put MyDll.dll into Bin folder for ASP.Net web site
>
But unfortunately an exception has been thrown
>
Unable to load DLL 'MyDll.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E).
>
Thank you,
>
Volodia.
>
Closed Thread