PC Review


Reply
Thread Tools Rate Thread

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

 
 
Volodia
Guest
Posts: n/a
 
      30th May 2007
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.


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      30th May 2007
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:
> 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.
>
>

 
Reply With Quote
 
Volodia
Guest
Posts: n/a
 
      30th May 2007
List of dependancies looks ok:
ADVAPI32.DLL
KERNEL32.DLL
NTDLL.DLL
RPCRT4.DLL

Thank you,
Volodia

"bruce barker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:
>> 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.



 
Reply With Quote
 
Volodia
Guest
Posts: n/a
 
      1st Jun 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Volodia
Guest
Posts: n/a
 
      6th Jun 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
=?Utf-8?B?cG9zdGVh?=
Guest
Posts: n/a
 
      20th Jun 2007


"Volodia" wrote:

> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?cG9zdGVh?=
Guest
Posts: n/a
 
      20th Jun 2007
"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
>
>
> "Volodia" wrote:
>
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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.
> > >

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Manage in unmanaged easier or unmanaged in managed garlic Microsoft Dot NET Compact Framework 5 28th Apr 2008 04:07 PM
Access violation in unmanaged code: Linking managed with unmanaged static libs Pixel.to.life Microsoft VC .NET 3 23rd Jul 2007 04:16 AM
Unmanaged dll call error from IIS asp.net site =?Utf-8?B?Y2hlbG9tYW4=?= Microsoft ASP .NET 0 6th Jun 2007 10:18 AM
call managed/unmanaged classes from unmanaged code bonk Microsoft VC .NET 1 1st Oct 2005 04:10 PM
Mixing Mananged and Unmanaged in an Unmanaged class Jon Microsoft VC .NET 18 7th Jun 2004 04:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 AM.