我正在使用.NET Core 2.0.2用C#编写一个ASP.NET web应用程序。
每次在我的控制器中使用
我设法找到了
以下是我的
每次在我的控制器中使用
Request.Url
时,dotnet run
都会输出错误:
error CS1061:'HttpRequest'不包含名为'Url'的定义,并且找不到接受类型为“HttpRequest”的第一个参数的扩展方法'Url'
Request.Params
也有同样的问题。尽管.NET文档中有Params
属性的getter。我设法找到了
Request.Url
的解决方法:我使用Request.GetUri()
方法。但我找不到Request.Params
的替代方法。以下是我的
using
语句:using System;
using System.Diagnostics;
using area.Models;
using Microsoft.AspNetCore.Identity;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.AspNetCore.Extensions;
using Microsoft.AspNetCore.Mvc;
using Tweetinvi;
using Tweetinvi.Models;
我为什么会遇到这些错误?你知道如何修复吗?否则,你有没有其他方法来获取Request.Params
?
Request.Query["oauth_verifier"]
。 - Shyju