public override void Process(TagHelperContext context, TagHelperOutput output) { try { output.TagName = null; var dependencyLoader = DependencyManager.GetLoader(_httpContextAccessor.HttpContext); //var fileVersionProvider = new FileVersionProvider( // _hostingEnvironment.WebRootFileProvider, // _cache, // ViewContext.HttpContext.Request.PathBase); //var sb = new StringBuilder(); var dependencyFiles = dependencyLoader.DependencyFiles .Where(df => df.DependencyType == DependencyType) .OrderBy(df => df.Priority) .ToList(); if (DependencyType == DependencyType.Css) { foreach (var file in dependencyFiles) { var itemBuilder = new TagBuilder("link"); string resolvedPath; if (file.FilePath.StartsWith("~")) { TryResolveUrl(file.FilePath, out resolvedPath); //resolvedPath = fileVersionProvider.AddFileVersionToPath(resolvedPath); } else { resolvedPath = file.FilePath; } itemBuilder.MergeAttributes(file.Attributes); itemBuilder.Attributes.Add("href", resolvedPath); itemBuilder.Attributes.Add("rel", "stylesheet"); output.Content.AppendHtml(itemBuilder); output.Content.AppendHtml(Environment.NewLine); } } else if (DependencyType == DependencyType.Script) { var filteredFiles = dependencyFiles.Where(df => df.ScriptLocation == ScriptLocation).ToList(); foreach (var file in filteredFiles) { var itemBuilder = new TagBuilder("script"); string resolvedPath; if (file.FilePath.StartsWith("~")) { TryResolveUrl(file.FilePath, out resolvedPath); //resolvedPath = fileVersionProvider.AddFileVersionToPath(resolvedPath); } else { resolvedPath = file.FilePath; } itemBuilder.MergeAttributes(file.Attributes); itemBuilder.Attributes.Add("src", resolvedPath); output.Content.AppendHtml(itemBuilder); output.Content.AppendHtml(Environment.NewLine); } } } catch (Exception ex) { throw ex; } }