我试图理解为什么我在一个项目(Web服务)上而不是WinForm项目上出现stackoverflow异常。
这是代码:
VimClient vimClient = new VimClient();
ServiceContent serviceContent = vimClient.Connect("https://servername/sdk");
UserSession us = vimClient.Login(username, password);
ManagedObjectReference _svcRef = new ManagedObjectReference();
_svcRef.Type = "ServiceInstance";
_svcRef.Value = "ServiceInstance";
NameValueCollection filterForVM = new NameValueCollection();
filterForVM.Add("Name", ServerName);
VirtualMachine vm = (VirtualMachine)vimClient.FindEntityView(typeof(VirtualMachine), null, filterForVM, null);
vimClient.Disconnect();
例外是在这条线上:
VirtualMachine vm = (VirtualMachine)vimClient.FindEntityView(typeof(VirtualMachine), null, filterForVM, null);
会是什么呢?
最佳答案
创建具有新堆栈大小的新线程解决了问题:)谢谢