Problem calling class that implements a COM interop DLL

  • Thread starter Thread starter Andrew Connell
  • Start date Start date
A

Andrew Connell

Using Interop, I created an assembly DLL that implements some of the methods within the COM DLL. In a WinForm app, it works great. But when I try to implement it in ASP.NET, I get the following error:
System.IO.FileNotFoundException: The specified module could not be found.

I've created a reference to the assembly I created and verified that both my custom DLL and the interop DLL are located in the \bin directory of the ASP.NET app.

Not sure it matters, but the interop is for the CAPICOM.dll. My assembly wraps the functionality and pulls the key from a specified location so the ASP.NET app just has to call my assembly and pass the string to be encrypted/decrypted.
 
Hi,

Can you send the full error description? It usually contains the
assembly name, version.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
Sure (i replaced my namespace and project name/directory... but that shouldn't change the issue). I tried accessing any method/property in the object on line 57 with no luck (line 57 is throwing the error). The Util object is in my custom assembly ([MyNamespacePrefix].Security.Cryptography.Capicom). That object references methods/properties exposed in my interop of the CAPICOM.dll.

-AC
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 55: Dim capicom As Util = New Util
Line 56: Dim decryptedQS As String
Line 57: capicom.Key = GetSecureKey()
Line 58: decryptedQS = capicom.DecryptData(Request.QueryString(0))
Line 59: Response.Write(decryptedQS & "<br />")


Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
[MyNamespacePrefix].Security.Cryptography.Capicom.Util.set_Key(String value)
[MyNamespacePrefix].[Project].Inbound.Page_Load(Object sender, EventArgs e) in C:\Projects\[project]\portalAuthentication\Inbound.aspx.vb:57
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
A bit of additional info... when I debug and stop on line 56, I can see that the 'capicom' variable is definately set to an object type... just confusing to me... the object definately looks like it's being created, but it isn't being seen as such.

-AC
Sure (i replaced my namespace and project name/directory... but that shouldn't change the issue). I tried accessing any method/property in the object on line 57 with no luck (line 57 is throwing the error). The Util object is in my custom assembly ([MyNamespacePrefix].Security.Cryptography.Capicom). That object references methods/properties exposed in my interop of the CAPICOM.dll.

-AC
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 55: Dim capicom As Util = New Util
Line 56: Dim decryptedQS As String
Line 57: capicom.Key = GetSecureKey()
Line 58: decryptedQS = capicom.DecryptData(Request.QueryString(0))
Line 59: Response.Write(decryptedQS & "<br />")


Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
[MyNamespacePrefix].Security.Cryptography.Capicom.Util.set_Key(String value)
[MyNamespacePrefix].[Project].Inbound.Page_Load(Object sender, EventArgs e) in C:\Projects\[project]\portalAuthentication\Inbound.aspx.vb:57
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
Back
Top