[英]Edge case: Can you configure Net.Core 3.1 to run in the same folder as Asp.Classic?
I am looking at migrating a huge Asp.Classic (3K files) to Net.Core 3.1 in steps (ie folder by folder migration).我正在考虑分步将巨大的 Asp.Classic(3K 文件)迁移到 Net.Core 3.1(即逐个文件夹迁移)。 We have figured out issues with sharing sessions and prefer not to go parallel sites (but may end going there if there is not a simple solution).
我们已经解决了共享会话的问题,并且不想去并行站点(但如果没有简单的解决方案,可能会结束)。
One line (in <-- --> below) in a merged Web.Config determines if Asp.Classic loads or Net.Core loads.合并的 Web.Config 中的一行(在下面的 <-- --> 中)确定是加载 Asp.Classic 还是加载 Net.Core。
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<!--<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />-->
</handlers>
<aspNetCore processPath="dotnet" arguments=".\WebApplication1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
I realize that ISAPI filter written in C++ is a possibility (in one way easy: if there is an .asp in the request go to Asp.Classic, otherwise pass to Net.Core).我意识到用 C++ 编写的 ISAPI 过滤器是一种可能性(以一种简单的方式:如果请求中有 .asp,则转到 Asp.Classic,否则传递到 Net.Core)。 Any alternatives before walking that path?
在走那条路之前有什么选择吗?
As far as I know, if you want to host classic asp and asp.net core at same IIS web site, you should modify your hanlder mapping to make the classic asp handler above the asp.net core module.据我所知,如果你想在同一个 IIS 网站上托管经典的 asp 和 asp.net 核心,你应该修改你的 hanlder 映射,使经典的 asp 处理程序位于 asp.net 核心模块之上。
Details, you could refer to below steps:详情可参考以下步骤:
1.Open the IIS management console and select handler mapping: 1.打开IIS管理控制台,选择处理程序映射:
2.Click the ordered list: 2.点击排序列表:
3.Move the classic asp up than the aspnet core 3.将经典的asp比aspnet核心上移
Brilliant solution!!!绝妙的解决方案!!! You forget too much when you end up being siloed in doing just high performance/high volume REST API's at Starbucks for many years.
当您多年来在星巴克只做高性能/大容量 REST API 时,您会忘记太多。
For clarification, Brando's solution works with both .Asp and .cshtml file loading on the test site.为了澄清起见,Brando 的解决方案适用于测试站点上的 .Asp 和 .cshtml 文件加载。
This caused the Web.Config to become much bigger... and I need to get some issues sorted out, specifically:这导致 Web.Config 变得更大......我需要解决一些问题,特别是:
<handlers> <clear /> <add name="ASPClassic" path="*.asp" verb="GET,HEAD,POST" type="" modules="IsapiModule" scriptProcessor="%windir%\\system32\\inetsrv\\asp.dll" resourceType="File" requireAccess="Script" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" /> <add name="aspNetCore" path="*" verb="*" type="" modules="AspNetCoreModuleV2" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" /> <add name="rules-Integrated" path="*.rules" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode,runtimeVersionv2.0" responseBufferLimit="4194304" /> <add name="AXD-ISAPI-4.0_32bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="PageHandlerFactory-ISAPI-4.0_32bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="SimpleHandlerFactory-ISAPI-4.0_32bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="WebServiceHandlerFactory-ISAPI-4.0_32bit" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="HttpRemotingHandlerFactory-rem-ISAPI-4.0_32bit" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="HttpRemotingHandlerFactory-soap-ISAPI-4.0_32bit" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="svc-ISAPI-4.0_32bit" path="*.svc" verb="*" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="rules-ISAPI-4.0_32bit" path="*.rules" verb="*" type="" modules="IsapiModule" scriptProcessor="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.