Registering a dll on 64 bit Windows Server 2008 Standard SP2 IIS 7

可紊 提交于 2019-12-08 02:23:32

问题


Project: VS2010 C# Class Library. Local machine: Win 7 64bit

Following items changed in the project:

Properties/AssemblyInfo.cs [assembly: ComVisible(true)]

Project/Properties/Build tab: Register Com for Interop: checked Generate Seralization assembly: auto

I have setup the test classes per following post with interfaces, comvisible=true and guids etc: Building a COM interop library for ASP Classic using 4.0 framework and Visual Studio 2010

I was able to register this dll on my local machine via regasm. C:\windows\Microsoft.Net\Framework\v4.0.30319>regasm NrccuaComFileSystem.dll

Types registered successfully.

On the server regsvr, regasm, regasm with tlb all fail with the following message:

RegAsm : error RA0000 : Could not load file or assembly 'file:///c:\Windows\Micr osoft.NET\Framework\v4.0.30319\NrccuaComFileSystem.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

What am i doing wrong here?

Is it looking for an entry point, if yes then totally lost as how to provide that.

Looked at the following post also... Classic ASP using COM+ .Net Interop 64 Bit Windows Server 2008 IIS 7 Server.CreateObject Fails

You can download the test project from here: http://bit.ly/wt5iJz

Thanks.


回答1:


It is working now. Following post helped.

Classic ASP using COM+ .Net Interop 64 Bit Windows Server 2008 IIS 7 Server.CreateObject Fails

We needed to install the windows sdk for .net framework 4

http://www.microsoft.com/download/en/confirmation.aspx?id=8279

Then we needed to add the assembly to the GAC

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools>gacutil /i C:\Windows\Microsoft.NET\Framework\v4.0.30319\File.dll

Then we needed to register the assembly with regasm

regasm /tlb File.dll



来源:https://stackoverflow.com/questions/9381707/registering-a-dll-on-64-bit-windows-server-2008-standard-sp2-iis-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!