iis只有clr

编程入门 行业动态 更新时间:2024-10-08 10:51:16

<a href=https://www.elefans.com/category/jswz/34/1765788.html style=iis只有clr"/>

iis只有clr

iis只有clr

UPDATE: Here is how we solved this problem.

更新:这是我们解决此问题的方法。

So, this is bizarre. The idea is this:

所以,这很奇怪。 这个想法是这样的:

We want to share FormsAuth cookies between two ASP.NET sites on the same box. No biggie, right? However, one of the ASP.NET sites also has some Classic ASP pages in it. Still, no worries, right?

我们希望在同一框上的两个ASP.NET站点之间共享FormsAuth cookie。 没关系,对吗? 但是,其中一个ASP.NET站点中也包含一些Classic ASP页面。 不过,不用担心,对不对?

  • The Classic ASP pages happen to use .NET objects that expose themselves to Classic ASP via COM Interop…

    经典ASP页面碰巧使用.NET对象,这些对象通过COM Interop将自己暴露于经典ASP。
  • If ASP.NET pages are hit ONCE in both sites (pools/appdomains) to 'bootstrap' the CLR, all is well and FormsAuthTickets will be sharable and jointly decryptable.

    如果在两个站点(池/应用程序域)中一次击中ASP.NET页以“引导” CLR,则一切正常,FormsAuthTickets将可以共享并且可以共同解密。
    • .NET 1.1 and .NET 2.0 are installed on the systems

      .NET 1.1和.NET 2.0安装在系统上
    • Both ASP.NET applications/vdirs are configured to use .NET 1.1 in IIS

      两个ASP.NET应用程序/ vdirs都配置为在IIS中使用.NET 1.1

PROBLEM: If the site that creates the FormsAuthenticationTickets instead has the CLR 'bootstrapped' into the process/pool/domain by hitting a Classic ASP page that calls the COM-interop DLL, it causes later FormsAuthentication crypto to produce tickets that can't be decrypted by the other application.

问题:如果创建FormsAuthenticationTickets的站点通过点击调用COM互操作DLL的Classic ASP页面而将CLR“引导”到了进程/池/域中,则会导致以后的FormsAuthentication加密生成无法生成的票证由其他应用程序解密。

QUESTION: What's going on? Both sites have web.config files with synchronized machinekeys (the machinekey is used by FormsAuth).

问题:怎么回事? 这两个站点都有带有同步机器密钥的web.config文件(该机器密钥由FormsAuth使用)。

PARTIAL ANSWER: Turns out that if the Classic ASP page (that uses the .NET object that is used via COM) is hit first then .NET 2.0 gets loaded up inside that IIS Managed Application even if the ASP.NET application is set to use .NET 1.1!

部分答案:事实是,如果首先点击Classic ASP页面(使用通过COM使用的.NET对象),则即使将ASP.NET应用程序设置为使用该.NET 2.0,它也会在该IIS托管应用程序中加载.NET 1.1!

Am I missing something? Does this mean that I can't have two classic ASP apps that use .NET objects via Interop, one using 1.1 and one using 2.0 on the same computer? Seems like it.

我想念什么吗? 这是否意味着我不能在同一台计算机上拥有两个通过Interop使用.NET对象的经典ASP应用程序,一个不能使用1.1,而另一个可以使用2.0? 看起来是这么回事。

The issue is that ASP.NET doesn't start up the CLR because it's not hit first. The Classic ASP page is hit first, and apparently can't control the CLR version it gets! By the time someone hits an ASP.NET page, the CLR is already loaded up with a different version.

问题在于ASP.NET不会启动CLR,因为它没有被首先点击。 首先点击Classic ASP页面,显然无法控制它获得的CLR版本! 当有人点击ASP.NET页面时,CLR已经加载了其他版本。

HERE'S THE KICKER: I don't yet understand why (on Win2k3, in our tests) the problem only happens when the anonymous identity for the web site is a domain account.  If the anonymous identity was left as the default IUSR_xxxx, the CLR loaded is still 1.1 when a CCW is created. (!)

凶手:我还不明白为什么(在Win2k3中,在我们的测试中)仅当网站的匿名身份是域帐户时才出现问题 如果将匿名身份保留为默认的IUSR_xxxx,则在创建CCW时加载的CLR仍为1.1。 ( )

OUR WORKAROUND: We just let .NET 2.0 load up anyway and run our 1.1 application. We have to synchronize the machinekeys in BOTH CLR versions' machine.config files though.

我们的替代方法:我们只是让.NET 2.0加载并运行1.1应用程序。 但是,我们必须同步两个CLR版本的machine.config文件中的机器密钥。

Kudos to Peter Wong for figuring this stuff out. Now the question is - is there a good workaround or better explanation? My guess is we'll hear "functions as designed" but it seems to me that even though you can't indicate in the COM Registration stuff in the Registry what CLR Version to use (it's listed in the Registry, but the values are ignored) there should be some way.

感谢Peter Wong弄清楚了这些东西。 现在的问题是-是否有一个好的解决方法或更好的解释? 我的猜测是,我们会听到“按设计的功能”,但在我看来,即使您无法在注册表的COM注册资料中指明要使用的CLR版本(在注册表中列出,但值会被忽略) )应该有一些方法。

Repro attached. Unzip this file into a c:\inetpub\wwwroot\wong test and make an IIS Application (isolated, or in its own AppPool in IIS). Get Process Explorer from SysInternals and hit x.asp after a fresh reset.

附有Repro。 将此文件解压缩到ac:\ inetpub \ wwwroot \ wong测试中,并制作一个IIS应用程序(已隔离,或在IIS中自己的AppPool中)。 从获取的Process Explorer Sysinternals的和新鲜的复位后打x.asp。

File Attachment: NET11_NET20_ASP.zip (894 bytes)

附件:NET11_NET20_ASP.zip(894字节)

翻译自:

iis只有clr

更多推荐

iis只有clr

本文发布于:2024-03-09 07:15:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1724258.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:iis   clr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!