C# dll to use in classic ASP

2019-08-05 00:51发布

I have the following C# code

namespace testDll
{
    class testDLL
    {
        public int add(int val)
        {
            return val + 5;
        }
    }
}

Created dll using Visual Studio Express 2010 i.e going to projet properties, changing the output type to classlibrary and Make assembly COM visible. Everytime I try to register the dll using regsvr32.exe

I get error dllregisterserver entrypoint was not found

1条回答
Evening l夕情丶
2楼-- · 2019-08-05 01:09

you cannot Register a .net dll with regsvr32.exe. you have to use regasm.exe. look here for a description

generally you just use

regasm.exe NameOfDotNetDLL.dll /codebase

furthermore you have to add the ComVisible attribute to your class and every method you want to have comvisible like so

[ComVisibleAttribute( true )]
查看更多
登录 后发表回答