注册DLL以使用64位操作系统 [英] register a DLL to work with 64 bit OS
问题描述
我有64位窗口7.我创建了classlibrary(VS2012)和SN /注册了
C:\> sn -k C :\ APPI3 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\ API2\test\obj\Debug / test.dll / tlb / codebase
它注册就好了,ASP可以很好地创建对象(如果我将APP POOLING设置为32位= true。)
但是如何为64位版本注册此dll?
我试图在编译到x64时更改目标CPU:但是当我想注册DLL时,我得到不是有效的.DLL。我甚至尝试过regsvr32但没有运气。任何建议?
请看我对这个问题的评论。dean rezo问:你能给我更多关于架构的细节:x86-64和Itanium(IE64)?
当然。请参阅:
http://en.wikipedia.org/wiki/Instruction_set [< a href =http://en.wikipedia.org/wiki/Instruction_settarget =_ blanktitle =New Window> ^ ],
http://en.wikipedia.org/wiki/X86-64 [ ^ ],
http://en.wikipedia.org/wiki/Itanium [ ^ ]。
构建.NET项目时,平台选项有四个选项(平台表示Visual Studio和MSBuild术语中的指令集架构:一个32位架构,两个64位架构,以及AnyCPU。 任何CPU都是可能的,因为程序集的CIL代码通常是从指令集体系结构中抽象出来的,因为.NET基于JIT编译。请参阅:
http://en.wikipedia.org/wiki/Just-in -time_compilation [ ^ ]。
在.NET程序集中,使用特定的指令集架构通常没有意义。但是,在使用某些本机代码时,或者某些本机(非托管)代码使用程序集时,这一点很重要。即使在这种情况下,某些进程/应用程序中涉及的大多数程序集也应编译(标记)为任何CPU。
-SA
Hi, I have 64 bit windows 7. I created classlibrary (VS2012) and SN/registered it with
C:\>sn -k C:\API3\test\bin\Debug\mykey.snk
C:\Windows\Microsoft.NET\Framework\v4.0.30319>regasm C:\API2\test\obj\Debug/test.dll /tlb /codebase
it registers just fine and ASP can create the object just fine (IF I set APP POOLING to 32 bit=true.)
But how can I register this dll for 64bit version?
I have tried to change the "target CPU:" under compile to x64 but when I want to register the DLL I get " in not a valid .DLL". I even tried regsvr32 but no luck. any suggestion?
Please see my comments to the question.dean rezo asked:Can you give me more details about architectures: x86-64 and Itanium (IE64)?
Sure. Please see:
http://en.wikipedia.org/wiki/Instruction_set[^],
http://en.wikipedia.org/wiki/X86-64[^],
http://en.wikipedia.org/wiki/Itanium[^].
When you build a .NET project, you have four options for the "Platform" option ("Platform" means instruction-set architecture in Visual Studio and MSBuild jargon): one 32-bit architecture, two 64-bit architectures, plus "AnyCPU". "Any CPU" is possible because CIL code of an assembly is generally abstracted from the instruction-set architectures, as .NET is based on JIT compilation. Please see:
http://en.wikipedia.org/wiki/Just-in-time_compilation[^].
In a .NET assembly, using a specific instruction-set architecture generally makes no sense. However, it is important when some native code is used, or the assembly is used by some native (unmanaged) code. Even in this case, most of the assemblies involved in some process/application should be compiled (marked) as "Any CPU".
—SA
这篇关于注册DLL以使用64位操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!