简体   繁体   English

如何将 On Action Execution 从 .net 转换为 .net 核心?

[英]How to convert On Action Execution from .net to .net core?

I am converting my .net application to .net core and have come across a few errors.我正在将我的 .net 应用程序转换为 .net 内核并遇到了一些错误。 can i please know on how to resolve the on Action execution as well as the URL error.我可以知道如何解决 on Action 执行以及 URL 错误。 Can I please get your help to resolve them.我可以请您帮忙解决它们吗? 在此处输入图像描述

1.Changing the access modifier of a method in a derived type is not allowed. 1.不允许更改派生类型中方法的访问修饰符。 You should change protected to public.您应该将保护更改为公开。

2.The HttpRequest object is different in ASP.NET Core. 2.ASP.NET Core中的HttpRequest object不同。 It no longer contains Url property.它不再包含 Url 属性。

By using:通过使用:

using Microsoft.AspNetCore.Http.Extensions;

then you can get the full http request url by executing:然后您可以通过执行以下命令获取完整的 http 请求 url:

HttpContext.Request.GetEncodedUrl();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM