比较两台服务器的 GAC?
在 BizTalk 迁移期间,我需要一种简单且值得信赖的方法来比较两台服务器的 GAC(全局程序集缓存)。如果目标服务器中不存在 GAC,我还想将其从 QA 移至生产。这些都是 BizTalk 服务器,并且拥有大量 GAC 程序集。我在网上看到了一些工具,但其中一个的链接已损坏(winmerge),而其他工具似乎并不真实。感谢您的帮助。
I need a easy and trusted way to compare GAC (Global Assembly Cache) from two servers, during BizTalk migration. I also want to move the GAC from QA to Production if it doesn't exist in the destination server. These are both BizTalk servers and have tons of assemblies GAC'd. I saw some tools online but the link to one was broken (winmerge) and others did not seem really authentic. Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当我需要在 GAC 中查找某些内容时,我总是只需运行 Gacutil.exe /l >从 Visual Studio(或者,如果不可用,则使用 Windows SDK)命令提示符打开 c:/gac.txt,然后在文本编辑器中搜索输出文件。您可以在两台计算机上执行此操作,并使用 Beyond Compare 之类的工具来比较两个 GAC。 Beyond Compare 还允许您进行目录比较,因此这可能比导出 GAC 中的内容列表更容易(如果您遵循本答案的下一部分)。
要导出程序集,您可以按照 http://blogs.msdn.com/b/johnwpowell/archive/2009/01/14/how-to-copy-an- assembly-from-the-gac.aspx 创建 GAC其行为类似于普通的 Windows 目录,使您能够复制并粘贴所需的文件。
不过,我要说的是,最好的选择是将 BizTalk 程序集放在打包的 MSI 文件中,您可以将其简单地导入到您想要的任何 BizTalk 服务器中(然后实际执行到 GAC)。这可确保您需要的内容位于 BizTalk 数据库中,因为 GAC 往往是不够的。
不过,如果您还没有准备好 MSI 文件,那么现在是制作它们的好时机。如果已使本地 GAC 可浏览,那么应该可以轻松浏览到程序集并将其作为资源添加到所需的任何 BizTalk 应用程序,然后将应用程序导出为 MSI 文件,其中将包括应用程序的所有资源。这样您就不必完全手动完成这一切。
当灾难发生时,或者如果您只需要添加另一个 BizTalk 服务器来实现负载平衡,如果没有准备好将所有内容部署到新服务器(并且也进行了记录),那么您就会陷入困境。
Whenever I need to find something in the GAC, I always just run
Gacutil.exe /l > c:/gac.txt
from a Visual Studio (or, if that's not available, Windows SDK) command prompt, and then search the output file in a text editor. You could do that on both machines and use a tool like Beyond Compare to compare the contents of the two GACs. Beyond Compare also let's you do directory comparisons, so that may be easier (if you follow the next part of this answer) than exporting a listing of what's in the GAC.To export assemblies, you can follow the instructions at http://blogs.msdn.com/b/johnwpowell/archive/2009/01/14/how-to-copy-an-assembly-from-the-gac.aspx to make the GAC behave like a normal Windows directory, enabling you to copy and paste the files that you need.
I will say, though, that the best option is to have your BizTalk assemblies in packaged MSI files that you can simply import into whatever BizTalk server you want (and then actually execute to GAC). This ensures that what you need is in the BizTalk database, because GACing is often not enough.
If you don't already have your MSI files ready to go, though, then now would be a good time to make them. If have made the local GAC browseable then it should be easy to browse to and add assemblies as a resource to whatever BizTalk application you want and to then export the application as an MSI file, which will include all of the application's resources. That way you don't have to do it all totally manually.
Not having everything ready to be deployed to a new server (and documented too) is a great way to find yourself stuck in a bind when a disaster strikes, or if you just need to add another BizTalk server for load balancing.