Я не смог найти стек вызовов для этой проблемы, похоже, с контроллером все в порядке, но есть проблема с «asp-href-include».
Вот исключение:
ArgumentException: The path in 'value' must start with '/'. (Parameter 'value')
Microsoft.AspNetCore.Http.PathString..ctor(string value)
Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsFileProvider.StartsWithBasePath(string subpath, out PathString rest)
Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsFileProvider.GetDirectoryContents(string subpath)
Microsoft.Extensions.FileProviders.Composite.CompositeDirectoryContents.EnsureDirectoriesAreInitialized()
Microsoft.Extensions.FileProviders.Composite.CompositeDirectoryContents.EnsureFilesAreInitialized()
Microsoft.Extensions.FileProviders.Composite.CompositeDirectoryContents.GetEnumerator()
Microsoft.AspNetCore.Mvc.TagHelpers.FileProviderGlobbingDirectory.EnumerateFileSystemInfos()+MoveNext()
System.Collections.Generic.List<T>.InsertRange(int index, IEnumerable<T> collection)
System.Collections.Generic.List<T>.AddRange(IEnumerable<T> collection)
Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, string parentRelativePath)
Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, string parentRelativePath)
Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
Microsoft.Extensions.FileSystemGlobbing.Matcher.Execute(DirectoryInfoBase directoryInfo)
Microsoft.AspNetCore.Mvc.TagHelpers.GlobbingUrlBuilder.FindFiles(Matcher matcher)
Microsoft.AspNetCore.Mvc.TagHelpers.GlobbingUrlBuilder.ExpandGlobbedUrl(string include, string exclude)
Microsoft.AspNetCore.Mvc.TagHelpers.GlobbingUrlBuilder.BuildUrlList(string staticUrl, string includePattern, string excludePattern)
Microsoft.AspNetCore.Mvc.TagHelpers.LinkTagHelper.BuildGlobbedLinkTags(TagHelperAttributeList attributes, TagHelperContent builder)
Microsoft.AspNetCore.Mvc.TagHelpers.LinkTagHelper.Process(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Razor.TagHelpers.TagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
AspNetCore.Views_Shared__Layout.<ExecuteAsync>b__17_0() in _Layout.cshtml
-
<meta charset="utf-8" />
<title>bizz - @ViewData["Title"]</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link asp-href-include="~/bundle/metronic-mandatory.min.css" rel="stylesheet" asp-append-version="true" /> <-- this line is highlighted red
<link asp-href-include="~/bizz/style/common.min.css" rel="stylesheet" asp-append-version="true" />
@RenderSection("style", false)
<script asp-src-include="~/bundle/metronic-mandatory.min.js" asp-append-version="true"></script>
<script asp-src-include="~/bundle/common.min.js" asp-append-version="true"></script>
<script asp-src-include="~/bundle/jquery-validation.min.js" asp-append-version="true"></script>
Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
AspNetCore.Views_Shared__Layout.ExecuteAsync()
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
код:
<html>
<head>
<meta charset="utf-8" />
<title>bizz- @ViewData["Title"]</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link asp-href-include="~/bundle/metronic-mandatory.min.css" rel="stylesheet" asp-append-version="true" />
<link asp-href-include="~/bizz/style/common.min.css" rel="stylesheet" asp-append-version="true" />
@RenderSection("style", false)
<script asp-src-include="~/bundle/metronic-mandatory.min.js" asp-append-version="true"></script>
<script asp-src-include="~/bundle/common.min.js" asp-append-version="true"></script>
<script asp-src-include="~/bundle/jquery-validation.min.js" asp-append-version="true"></script>
@RenderSection("script", false)
... other code
контроллер (при необходимости)
public ViewResult Index()
{
return View();
}
РЕДАКТИРОВАТЬ: Может быть, я забыл упомянуть, что html находится внутри _Layout.cshtml,Это как-то связано с проблемой? Кроме того, я все, что я пишу в нем, восстанавливается, как это было.
EDIT2: я отредактировал свой код в соответствии с одним из комментариев. Ошибка остается прежней. фотография