我的 asmx 服务在我本地机器的 iis(即 win10)上运行良好。但不适用于 windows 服务器 2008 r2

my asmx service works fine on my local machine's iis which is win10. but does not work on windows server 2008 r2

我有一个 asmx 网络服务,它只是调用 KayitKontrol() 下面的一个方法。该方法使用的是 com 对象。它在我的本地机器上工作,但当它在服务器 2008 上尝试时,它停止创建 com 对象 class Kernel.I 在两个 iis 上具有相同的设置。我一个星期都想不通。我用 fiddler 对它进行了分析,它只是没有响应给出 504 响应。

我没有安装应用服务器。有什么关系吗?

private void KayitKontrol()
        {
            using (SqlConnection conn = new SqlConnection("server=" + serverName + ";initial catalog=" +
                                                          dataBase + ";integrated security=false;uid=" +
                                                          sqlUser + ";password=" + sqlPass + ";"))
            {
                try
                {
                    foreach (var el in kasalist)
                        {
                            try
                            {
                                LogYaz("Kasa Kayıt Atılıyor.");
                                Kernel kernel = new Kernel();//stops right here which is com object.
                                Sirket sirket = default(Sirket);
                                Kasa kasa = default(Kasa);
                                sirket = kernel.yeniSirket(TVTTipi.vtMSSQL,
                                    el.Sirket,
                                    "TEMELSET",
                                    "",
                                    netUser,
                                    netPass,
                                    0);
                                kasa = kernel.yeniKasa(sirket);
                                kasa.KsMas_Kod = el.KasaKodu; //Kasa Kodu
                                kasa.IO = "C";
                                kasa.Tip = "C";
                                kasa.Kod = el.CariKodu; //Cari Kodu
                                kasa.Fisno = el.Fisno;
                                kasa.CariHareketAciklama = "Avans ödemesi(e-flow)";
                                kasa.Aciklama = el.Aciklama;
                                kasa.Tutar = el.TlTutar;
                                kasa.Plasiyer_Kodu = "3500";
                                kasa.Tarih = el.Tarih;
                                kasa.DovizTut = el.DovTutar;
                                kasa.DovizTipi = el.Dovtipi;
                                kasa.Islem(TKasaIslem.tkCariOdeme);
                                Marshal.ReleaseComObject(kasa);
                                Marshal.ReleaseComObject(sirket);
                                kernel.FreeNetsisLibrary();
                                Marshal.ReleaseComObject(kernel);
                            }
                            catch (Exception exception)
                            {
                                LogYaz(exception.ToString());
                            }
                            finally
                            {
                                LogYaz("1 kasa kaydı atıldı.");
                            }
                        }
                    }
                }
                catch (Exception exception)
                {
                    LogYaz(exception.ToString());
                }
}

当 BL 崩溃时,Fiddler 无法帮助您...:) windows 事件日志中有任何内容吗?您的日志语句 (LogYaz) 去了哪里,里面有什么吗?

我发现了问题。这是关于 iis 应用程序池设置中的身份帐户。我在那里设置了一个管理员帐户,现在可以使用了。我是新手