VimApi 命名空间类所需的 VMware vSphere SDK C# 示例引用在哪里?
我无法使用 Visual Studio 从 VMware vSphere SDK 5.0 编译 C# 示例2010。错误是缺少命名空间 AppUtil
和 VimApi
的引用。
VS2010解决方案文件中的引用指向这些文件。
..\AppUtil\bin\Debug\AppUtil.dll
..\..\Vim25Service2010.dll
..\..\Vim25Service2010.XmlSerializers.dll
..\..\VimService2010.dll
..\..\VimService2010.XmlSerializers.dll
..\VMware.Security.CredentialStore\bin\Debug\VMware.Security.CredentialStore.dll
这些文件在 SDK 中的哪里?如果 SDK 中没有,我该如何获取它们?
其中两个参考来自解决方案中的其他项目;包括 AppUtil
命名空间。我可以更新每个项目以引用该项目而不是调试输出。
我是否缺少生成其他 dll 的构建步骤? VimApi
是不同下载的一部分吗?发行说明没有提及用于编译项目的额外下载。
I cannot compile the C# samples from the VMware vSphere SDK 5.0 using Visual Studio 2010. The error is missing references for namespaces AppUtil
and VimApi
.
The references in the VS2010 solution file point to these files.
..\AppUtil\bin\Debug\AppUtil.dll
..\..\Vim25Service2010.dll
..\..\Vim25Service2010.XmlSerializers.dll
..\..\VimService2010.dll
..\..\VimService2010.XmlSerializers.dll
..\VMware.Security.CredentialStore\bin\Debug\VMware.Security.CredentialStore.dll
Where are these files in the SDK, or how do I get them if not in the SDK?
Two of the references are from other projects in the solution; including the AppUtil
namespace. I can update each project to reference the project instead of the debug output.
Is there a build step I am missing to generate the other dlls? Is VimApi
part of a different download? The release notes don't mention additional downloads to get the projects to compile.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我不想回答我自己的问题,但我想出了一个解决方案。基于知识库文章从自述文件中指出我能够为 VS2010 创建指令。从 Visual Studio 命令提示符内包含解决方案文件的目录运行以下命令。
该脚本从 SDK 中的 wsdl 文件创建所需的 dll 文件。
I hate to answer my own question, but I came up with a solution. Based on the KB article pointed to from the readme I was able to create instructions for VS2010. Run the following commands from the directory that has the solution file inside a Visual Studio command prompt.
This script creates the needed dll files from the wsdl files in the SDK.
开发人员设置指南的第 3 章解释如何构建 VimService dll。杰森上面的脚本可以工作,但遗漏了一个极其重要(且令人恼火)的步骤。
生成 XMLSerializer dll 后,您需要编辑 VimService.cs 文件以强制引用 XMLSerializer 程序集并删除内联 XMLIncludeAttribute 调用。编辑后(设置指南中对此进行了说明),您需要重新编译 VimService。
它无需进行编辑即可工作,但在实例化 VimService 时可能会导致巨大的延迟。我发现要等3分钟,这是不可接受的。如果您遇到延迟,请根据说明重新编译 VimService 并更新对新程序集的引用(并确保您的构建不会保留在旧版本上)。
Chapter 3 of the developers setup guide explains how to build the VimService dlls. Jason's script above works, but leaves out one critically important (and irritating) step.
After generating the XMLSerializer dll, you need to EDIT the VimService.cs file to force the reference to the XMLSerializer assembly and remove the inline XMLIncludeAttribute calls. After the edit (which is explained in the setup guide) you need to recompile VimService.
It works without doing the edit, but it can cause a HUGE delay when instantiating VimService. I found it to be a 3 minute wait, which was unacceptable. If you're encountering the delay, recompile VimService according to the instructions and update your reference to the new assembly (and make sure your build isn't hanging on to the old version).
有关如何修改 VimService.cs 文件的示例说明可以在此处找到。
http://kb.vmware.com /selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=87402
Example instructions on how to modify the VimService.cs file can be found here.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=87402
VMware 没有像以前那样预先构建程序集,这真是遗憾。如果您按照说明正确操作并避免挂起,则需要手动编辑数百行。所以我编写了一些脚本来正确执行此操作。
您可以在这里找到它们...
It's a real shame VMware didn't pre-build the assemblies like before. There are 100s of lines to manually edit if you follow their instructions to do it properly and avoid hangs. So I wrote some scripts to do this properly.
You can find them here...
我也遇到过dll丢失的情况。我也选择在 VMware.Vim.dll 上构建,但现在也有点被淘汰了。我正在使用 PowerCLI 中找到的那个,但突然它就消失了。
我已经向社区请求答案,但没有人回答......看看:
http://communities.vmware.com/message/1815356#1815356
我还写了一个小“如何开始”但变得完全没有反馈。它也已经过时了,因为 dll 现在已经消失了。但当您找到正确的 dll 时,也许它会有所帮助:
http://communities.vmware.com/message/1806388#1806388
希望这会有所帮助,至少通过表明什么不该做。
问候,
谢尔斯基
I also experienced that the dlls are missing. I've chosen to build on the VMware.Vim.dll too but am sort of boated out now too. I was using the one that was found in the PowerCLI, but suddenly it's gone.
I've already requested an answer from the community but nobody answered that... have a look:
http://communities.vmware.com/message/1815356#1815356
I've also written a small "how to start" but became no feedback at all. It's outdated too since the dll is gone now. But maybe it helps when you've found the right dlls:
http://communities.vmware.com/message/1806388#1806388
Hope this helps, at least by showing what not to do.
Greetings,
Kjellski