B
Brian Anderson
Hello,
is it possible to use DllImport to call a DLL in ASP.NET ?
Or is it necessarry that my DLL has to be copied into \System32 ?
My DLL is a native C++ 7.1 DLL (not managed, no COM, no regsvr32) and uses
Assembler to make some math in SSE.
The result is given out as an Int.
Using a C# console app (code below) it work fine & fast.
However, once again ASP.NET refuses to execute my inline ASP.NET code (code
below).
Error Code:
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.DllNotFoundException: Unable to load DLL (pac.dll).nable to load DLL
(pac.dll).]Stack Trace: [DllNotFoundException: Unable to load DLL
(pac.dll).]
Even the tip out of G00gle to use the full path in DllImport wasn't a
solution.
I've check this on my ISPs websapce and on my local IIS6.
Is the reason for this problem the general extremely over-limited runtime
permission of ASP.NET ?
Can ASP.NET or IIS6 be told to allow DllImport calls to my DLL ?
My ISP is ready to make configuration changes for my case but don't know a
solution, too.
Thx for your opinions !
// Code EXE Console
public class Class1
{
[DllImport("pac.dll")]
public static extern int PaqGetVersion();
public static void Main(string[] args)
{
int t = Class1.PaqGetVersion();
Console.WriteLine(t);
[...]
// CODE ASP.NET
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Runtime.InteropServices" %>
<HTML>
<HEAD>
<Meta Name="CODE_LANGUAGE" Content="C#">
<Script Language=CS Runat=Server>
[DllImport(@"pac.dll")]
public static extern int PaqGetVersion();
void Page_Load(object sender, System.EventArgs e)
{
int i = PaqarGetVersion();
TextBox1.Text = i.ToString();
}
</script>
</HEAD>
[...]
is it possible to use DllImport to call a DLL in ASP.NET ?
Or is it necessarry that my DLL has to be copied into \System32 ?
My DLL is a native C++ 7.1 DLL (not managed, no COM, no regsvr32) and uses
Assembler to make some math in SSE.
The result is given out as an Int.
Using a C# console app (code below) it work fine & fast.
However, once again ASP.NET refuses to execute my inline ASP.NET code (code
below).
Error Code:
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.DllNotFoundException: Unable to load DLL (pac.dll).nable to load DLL
(pac.dll).]Stack Trace: [DllNotFoundException: Unable to load DLL
(pac.dll).]
Even the tip out of G00gle to use the full path in DllImport wasn't a
solution.
I've check this on my ISPs websapce and on my local IIS6.
Is the reason for this problem the general extremely over-limited runtime
permission of ASP.NET ?
Can ASP.NET or IIS6 be told to allow DllImport calls to my DLL ?
My ISP is ready to make configuration changes for my case but don't know a
solution, too.
Thx for your opinions !
// Code EXE Console
public class Class1
{
[DllImport("pac.dll")]
public static extern int PaqGetVersion();
public static void Main(string[] args)
{
int t = Class1.PaqGetVersion();
Console.WriteLine(t);
[...]
// CODE ASP.NET
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Runtime.InteropServices" %>
<HTML>
<HEAD>
<Meta Name="CODE_LANGUAGE" Content="C#">
<Script Language=CS Runat=Server>
[DllImport(@"pac.dll")]
public static extern int PaqGetVersion();
void Page_Load(object sender, System.EventArgs e)
{
int i = PaqarGetVersion();
TextBox1.Text = i.ToString();
}
</script>
</HEAD>
[...]