简体   繁体   English

极端情况:您能否将 Net.Core 3.1 配置为在与 Asp.Classic 相同的文件夹中运行?

[英]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。

  • Commented out: Asp.Classic注释掉:Asp.Classic
  • Uncomment: Net.Core取消注释: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 变得更大......我需要解决一些问题,特别是:

  • Where will static files come from (classic folder structure or netcore folder structure)静态文件来自哪里(经典文件夹结构或 netcore 文件夹结构)

 <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.

相关问题 如何在 net.core 3.1 上使用 DI 正确配置身份核心? - How to configure properly Identity core with DI on net.core 3.1? C# - ASP NET.CORE 3.1 - 表中更新记录的问题 - C# - ASP NET.CORE 3.1 - problem with update record's in table 如何配置 Kestrel 以使用随机动态端口并在运行时使用 ASP.NET Core 3.1 确定端口? - How do you configure Kestrel to use a random dynamic port and determine the port at run-time with ASP.NET Core 3.1? 我可以在非 ASP.NET Core 的 .NET.core 应用程序中使用 HttpClientFactory 吗? - Can I use HttpClientFactory in a .NET.core app which is not ASP.NET Core? 如何在 net.core 3.1 中连接打开的 excel 应用程序? - How to connect an open excel application in net.core 3.1? 由于 Startup.Configure NullReferenceException,新生成的 ASP.NET Core 3.1 应用程序将无法运行 - Newly generated ASP.NET Core 3.1 app won't run due to Startup.Configure NullReferenceException 在 ASP Net.Core 2.2 中使用自动属性扩展 AnchorTagHelper - Extend AnchorTagHelper with automatic attribute in ASP Net.Core 2.2 如何在 ASP.NET Core 3.1 生产中配置 IdentityServer - How to configure IdentityServer in ASP.NET Core 3.1 production ASP.NET Core 3.1 - 在启动中配置自定义 JSON - ASP.NET Core 3.1 - Configure custom JSON in Startup 如何在 asp net core 3.1 中配置身份? - How do I configure Identity in asp net core 3.1?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM