使用 .NET 复制管理对象 RMO 的 Powershell 问题
我正在尝试自动重新初始化多个复制 从分发服务器匿名获取的订阅。我是 在 Powershell 中从事这个项目,我相信我有一个 .NET 复制管理对象的 64 位与 32 位问题 (RMO)。我正在加载 RMO 和复制程序集。区域管理组织 程序集加载 MSIL 版本,但复制程序集仅 在 X86 或 X64 中可用。
我遇到的问题是 Microsoft.SqlServer.Replication.TransSynchronizationAgent 类不是 当我在 64 位计算机上运行脚本时可用。当我在 32位机器运行正常。
当我尝试在 64 位机器上创建该类的新对象时,我 收到类未注册的错误。我查看了 注册表并且该类已在 64 位和 64 位版本的 GAC 中注册 32 位(Wow6432Node)位置。
以前有人遇到过这个问题吗?有关修复的任何想法吗?
谢谢你, 瑞奇
I am trying to automate the reinitialization of several replication
subscriptions that pull anonymously from the distribution server. I am
working on this project in Powershell and I believe I am having a
64bit vs 32bit problem with the .NET Replication Management Objects
(RMO). I am loading the RMO and Replication assemblies. The RMO
assembly loads the MSIL version, but the Replication assembly is only
available in either X86 or X64.
The problem that I am having is that the
Microsoft.SqlServer.Replication.TransSynchronizationAgent Class is not
available when I run my script on a 64bit machine. When I run it on a
32bit machine it works fine.
When I try to create a new-object of that Class on a 64bit machine, I
get an error that the Class is not registered. I looked in the
registry and the Class is registered with the GAC in both 64bit and
32bit(Wow6432Node) locations.
Has anyone ever experienced this issue before? Any ideas on a fix?
Thank you,
Rickey
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近在使用 Powershell 时遇到了类似的 x64 与 x32 位问题。它与 Windows 文件系统重定向相关(更多信息请参见:http ://practicaladmin.wordpress.com/2010/07/16/powershell-x64-and-filesystem-redirection/)
如果您尝试实例化来自 32 位内存空间的 64 位 Powershell 实例(32 位 PID 或在 32 位模式下运行的 PID/等),Windows 尝试“做正确的事情”并执行 32 位版本的 Powershell(在 syswow64 文件夹中 - 是的,32 位 powershell位于 syswow64 文件夹中)。
尝试使用以下路径在 64 位机器上显式运行 64 位版本的 Powershell.exe:
I ran into a similar x64 vs x32 bit issue with Powershell recently. Its related to Windows Filesystem Redirection (more info here: http://practicaladmin.wordpress.com/2010/07/16/powershell-x64-and-filesystem-redirection/)
If you try to instantiate a 64bit Powershell instance from within a 32bit memory space (32bit PID or a PID running in 32bit mode/etc), Windows tries to "do the right thing" and executes the 32bit version of Powershell (in the syswow64 folder - yes, the 32bit powershell lives in the syswow64 folder).
Try running the 64bit version of Powershell.exe explicitly on the 64bit box using the following path: