C# 在Azure下运行的ieframe.dll中找不到Interop函数的DllImport入口点

C# 在Azure下运行的ieframe.dll中找不到Interop函数的DllImport入口点,c#,cookies,azure,dllimport,ieframe.dll,C#,Cookies,Azure,Dllimport,Ieframe.dll,在Azure下运行的C#应用程序中,我需要使用Interop/DllImport在ieframe.dll中调用'IEGetProtectedModeCookie' 这是签名: [DllImport("ieframe.dll", CharSet = CharSet.Unicode, EntryPoint = "IEGetProtectedModeCookie", SetLastError = true)] public static extern int IEGetProtectedMod

在Azure下运行的C#应用程序中,我需要使用Interop/DllImport在ieframe.dll中调用'IEGetProtectedModeCookie'

这是签名:

  [DllImport("ieframe.dll", CharSet = CharSet.Unicode, EntryPoint = "IEGetProtectedModeCookie", SetLastError = true)]
  public static extern int IEGetProtectedModeCookie(String url, String cookieName, StringBuilder cookieData, ref int size, uint flag);
我已经将ieframe.dll添加到我的项目的bin目录中,并且我有一个对SHDocVw的引用,该引用在我的obj目录中生成调试或零售Interop.SHDocVw.dll文件

当我在我的dev box上测试时,一切正常,但是当我部署到Azure时,我得到以下运行时错误:

System.EntryPointNotFoundException:找不到入口点 在DLL“ieframe.DLL”中命名为“IEGetProtectedModeCookie”。在 Predicere.Utilities.LoginUtils.IEGetProtectedModelCookie(字符串url, 字符串cookieName、StringBuilder cookieData、Int32和大小、UInt32标志) 在Predicere.Utilities.LoginUtils.GetProtectedModelieCookeValue(字符串 cookieName,Boolean isFacebookPage)在blah中


我在这里遗漏了什么?

IEGetProtectedModelCookie是在IE8中引入的。是否只安装了IE6或IE7?

因此,我们最终通过S.O.对另一个独立但相关问题的反馈找到了解决方案

问题是IEGetProtectedModeCookie直到IE8才引入,但基线Azure web实例基于IE7

OS风格由osFamily属性控制,具体如下:

<ServiceConfiguration serviceName="Foobar" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*">

此设置安装基于IE7的Windows Server 2008 SP2

如果我们按照以下方式修改osFamily属性,我们最终将使用基于IE8的Windows Server 2008 R2:

<ServiceConfiguration serviceName="Foobar" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="2" osVersion="*">

更多细节可以在这篇博客文章中找到,特别是如果你想升级你的Azure实例以使用IE9(事实证明,IE9是非常重要的)


我不确定Azure上的默认浏览器是什么(如果事实上存在任何默认浏览器)。但是,我认为如果我将ieframe.dll与解决方案一起包含在其“bin”目录中,并且还引用了ieframe.dll(它实际上最终生成Interop.SHDocVw.dll),那么我将拥有Azure服务器上所需的所有二进制位。为什么还要在Azure上调用IEGetProtectedModeCookie?看起来很奇怪。我们的应用程序在IFRAME中托管了一个小部件(相同的域)。对于IE8,服务器读取站点和小部件之间共享的cookie的唯一方法是使用IEGetProtectedModeCookie。如果还有其他方法,我洗耳恭听。但根据我们的研究,没有其他方法可以做到这一点。当使用“localhost”进行测试时,它可以工作;如果没有,Cookie对服务器是不可见的。我们认为问题与32位与64位DLL有关。我使用的是64位的box,我们在64位上部署到Azure。但我的业务合作伙伴的部署箱是一台32位机器,我们认为他的旧平台已经成为我们Azure部署的最低公分母。我正在我的64位机器上设置Azure部署,以便我们可以测试这个理论。如果我们是对的,他可能会得到一个64位的盒子。