首先,我搜索了这个错误,没有找到任何东西。完整的例外:
System.InvalidOperationException: The relative page path 'About' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page.
at Microsoft.AspNetCore.Mvc.UrlHelperExtension
我正在尝试为AspNet Core1.1执行一些过时的教程项目(当我使用VisualStudio2019预览2.0和.net核心v3.0.0-预览9安装时)
我已经有了一个包含由EntityFrameworkCore3.00创建的几个表的数据库-预览,它可以正常工作。
现在我试图将自动化添加到项目中,因此我从IdentityDbContext派生出数据库上下文类,
public class MyDbContext : IdentityDbContext
而不是
public class WorldContext : DbContext
添加迁移和更新数据库,在数据库中我看到了许多新表。
此时,
尝试在IIS中运行项目时,会发生以下错误
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Cannot find compilation library location for package 'Microsoft.Build'
at Mi
我试着:
public class VoySignInManager : SignInManager<IdentityUser>
{
public VoySignInManager(Microsoft.AspNetCore.Identity.UserManager<Microsoft.AspNetCore.Identity.IdentityUser> userManager, Microsoft.AspNetCore.Http.IHttpContextAccessor contextAccessor, Microsoft.AspNetCore.Identity.
我已经安装了.net核心2.2.0,我正在尝试从我使用VisualStudio2017发布的同一台PC的部署文件夹中运行asp.net核心mvc应用程序的发布版本。
当我去运行它时,该项目将按照预期在我的443端口上启动和扩展When服务器,但是当我访问服务器时,Kestrel会发出一条错误消息:
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLLBBV3878EF", Request id "0HLLBBV3878EF:00000003": An unhandled e
我的日志文件中有一个异常。问题是,我的Startup.Configure()方法中有一个全局异常处理程序:
app.UseExceptionHandler("/Home/Error");
它实际上被称为get。所以异常被处理了。如何禁止将此消息放入日志文件?
谢谢!
ERROR|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|An unhandled exception has occurred while executing the request. Microsoft.AspNetCore.Server
我使用以下命令:
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
使用堆栈跟踪时,我得到以下错误:
System.ArgumentNullException: Value cannot be null.
Parameter name: value
at System.IO.BinaryWriter.Write(String value)
at Microsoft.AspNetCore.Identity.DataProtectorTokenProvider`1.GenerateA
我正在升级一个.net核心2.2应用程序到.net 6。
我有一个api来注册用户,然后发送电子邮件确认。我正在生成这样的确认代码,但是下面的消息出错了。
任何想法
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
引发的错误:
System.Security.Cryptography.CryptographicException: An error occurred while trying to encrypt the provided data. Refer to the inner exc
我已经设置了加载eShopOnContainer的环境,它在我的docker中编译并运行。当转到页面时,出现此异常..
An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
Generated Code
The type 'RazorViewAttribute'
我正在使用Html Agility Pack从URL获取meta标签。我使用的是HtmlWeb的Load,但是我发现它花的时间太长了,我想我可以使用异步方法来提高性能,然而,当我尝试使用LoadFromWebAsync时,我得到了一个NullReferenceException。 使用Load public static MetaTags GetMetaData(string url)
{
// This works
var webGet = new HtmlWeb();
var document = webGet.Load(url);
var metaTa
当试图从码头映像运行我的应用程序时,我收到了以下错误:
Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.ApplicationInsights.AspNetCore', version: '1.0.2', path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'
码头图像是基于microsoft/aspnetcore的。
使用d
当我构建我的asp.net Core2.2应用程序时,我得到一个警告
There was a conflict between "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=a
我已经将Visual studio 2019更新为16.4.0版。此版本包括.NET Core SDK 3.1.100。
在那之后,我试着用Target Framework 2.2运行我在一个项目上的一些单元测试,但是它不能这样做。它给出了以下错误:
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: It was not possible to find any compatible framework version
The fr