2011-09-14 85 views
0

下运行在此的Azure中运行我的C#应用​​程序没有发现,我需要使用互操作/的DllImport调用“IEGetProtectedModeCookie”在ieframe.dll的DllImport切入点互操作功能ieframe.dll天青

这里的签名:

[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生成调试或零售Interop.S HDocVw.dll文件在我的obj目录中。

当我测试这个在我的dev的盒子,一切正常,但是当我部署到Azure中,我得到以下运行时错误:

System.EntryPointNotFoundException: Unable to find an entry point named 'IEGetProtectedModeCookie' in DLL 'ieframe.dll'. at Predicere.Utilities.LoginUtils.IEGetProtectedModeCookie(String url, String cookieName, StringBuilder cookieData, Int32& size, UInt32 flag) at Predicere.Utilities.LoginUtils.GetProtectedModeIECookieValue(String cookieName, Boolean isFacebookPage) in blah...

缺少什么我在这里?

回答

0

因此,我们终于找到了一个使用S.O.的反馈的解决方案。在另一个单独但相关的问题上。

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

操作系统的味道是由osFamily ATTRIB受控:

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

此设置将安装Windows Server 2008 SP2,它是基于IE7。

如果我们修改osFamily ATTRIB如下,我们结束了与Windows Server 2008 R2,它是基于IE8:特别是如果你想

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

更多细节可以在此博客条目中找到,升级你的Azure实例使用IE9(事实证明,这是不平凡的)。

http://sajojacob.com/blog/2011/03/startup-tasks-elevated-privileges-vm-role/

0

IEGetProtectedModeCookie与IE8一起推出。难道只有IE6或IE7被安装?

+0

我不知道在Azure上的默认浏览器是什么(如果,事实上,有*任何*默认浏览器的话)。然而,我认为,如果我在其bin目录中包含ieframe.dll和解决方案,并且还引用了ieframe.dll(实际上最终生成Interop.SHDocVw.dll),那么我将拥有所有二进制位在Azure服务器上是必需的。 –

+0

为什么你要在Azure上调用IEGetProtectedModeCookie?看起来很奇怪。 –

+0

我们的应用程序有一个在IFRAME中托管的小部件(相同的域)。对于IE8,服务器读取站点和小部件之间共享的cookie的唯一方法是使用IEGetProtectedModeCookie。如果还有其他方法可以做到这一点,我就会全神贯注。但基于我们的研究,没有其他方法可以做到这一点。当使用'localhost'测试它时,它可以工作;没有,cookie对服务器是不可见的。 –