DllImport doesn"t work in ASP.NET for old C-style dlls

DllImport doesn"t work in ASP.NET for old C-style dlls

am 11.04.2008 00:31:36 von Chris Bordeman

Using VS2008.

Have an old straight C style dll (*NOT* *COM*), need to call it from
ASP.NET. This
normally works easily using DllImport but ASP.NET apparently doesn't let you
call C dlls directly.

So I heard you can call COM dlls by just adding a reference. So I created a
C# class library with a single class that wraps and calls my C dll through
DllImport. I checked the 'Make COM Visibile' option and compiled. Used
regasm.exe to register the dll w/ COM, which reported success.

But I do 'add reference' on the ASP.NET app and the object is not to be
found on the COM list.

Isn't it supposed to show up?

Is there a better way? Or a way to avoid COM altogether?


And the first person to respond with an example of how to use DllImport is
getting dropped kicked in the nuts cuz they didn't read the question.