在IIS

时间:2015-10-06 20:43:49

标签: asp.net iis google-api google-compute-engine

我正在为我们的Ops部门编写应用程序,以允许他们通过我们的内部门户网站管理我们的Google虚拟机。在尝试将应用程序部署到IIS时,我遇到了一些障碍。

我使用以下代码,这些代码大部分直接来自API文档。

var certificate = new X509Certificate2(keyFile, "notasecret", X509KeyStorageFlags.Exportable);

var credential = new ServiceAccountCredential(
            new ServiceAccountCredential.Initializer(serviceAccountEmail)
            {
                Scopes = new[] { ComputeService.Scope.Compute }
            }.FromCertificate(certificate));

var service = new ComputeService(new BaseClientService.Initializer()
        {
            HttpClientInitializer = credential,
            ApplicationName = "ComputeEngineApp",                
        });

//...
//...

var request = service.Instances.List(_projectId, zone);
var result = request.Execute()

上面的代码在运行本地单元测试时工作正常。但是,当我尝试在IIS中托管代码时,request.Execute()行将永久挂起。我让我的调试器运行了几个小时,而Execute方法永远不会返回或抛出异常。

我已经使用Fiddler检查了我的计算机的网络流量,我可以看到,使用IIS时,请求永远不会被发送出去。我在IIS(应用程序池设置,用户帐户等)中尝试了各种故障排除,但没有运气。此时我已经烧了大约两天试图解决这个问题,我觉得解决方案可能很简单,但是API方法没有任何错误信息或反馈,我有很难取得任何进展。

任何帮助将不胜感激!

0 个答案:

没有答案