React to resource renames
This commit is contained in:
parent
645b82d194
commit
5164d647c5
|
|
@ -32,6 +32,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
[TargetElement("link", Attributes = FileVersionAttributeName)]
|
[TargetElement("link", Attributes = FileVersionAttributeName)]
|
||||||
public class LinkTagHelper : TagHelper
|
public class LinkTagHelper : TagHelper
|
||||||
{
|
{
|
||||||
|
private static readonly string Namespace = typeof(LinkTagHelper).Namespace;
|
||||||
|
|
||||||
private const string HrefIncludeAttributeName = "asp-href-include";
|
private const string HrefIncludeAttributeName = "asp-href-include";
|
||||||
private const string HrefExcludeAttributeName = "asp-href-exclude";
|
private const string HrefExcludeAttributeName = "asp-href-exclude";
|
||||||
private const string FallbackHrefAttributeName = "asp-fallback-href";
|
private const string FallbackHrefAttributeName = "asp-fallback-href";
|
||||||
|
|
@ -40,7 +42,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
private const string FallbackTestClassAttributeName = "asp-fallback-test-class";
|
private const string FallbackTestClassAttributeName = "asp-fallback-test-class";
|
||||||
private const string FallbackTestPropertyAttributeName = "asp-fallback-test-property";
|
private const string FallbackTestPropertyAttributeName = "asp-fallback-test-property";
|
||||||
private const string FallbackTestValueAttributeName = "asp-fallback-test-value";
|
private const string FallbackTestValueAttributeName = "asp-fallback-test-value";
|
||||||
private const string FallbackJavaScriptResourceName = "compiler/resources/LinkTagHelper_FallbackJavaScript.js";
|
private readonly string FallbackJavaScriptResourceName = Namespace + ".compiler.resources.LinkTagHelper_FallbackJavaScript.js";
|
||||||
private const string FileVersionAttributeName = "asp-file-version";
|
private const string FileVersionAttributeName = "asp-file-version";
|
||||||
private const string HrefAttributeName = "href";
|
private const string HrefAttributeName = "href";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
||||||
{
|
{
|
||||||
public static async Task<string> ReadResourceAsStringAsync(this Assembly assembly, string resourceName)
|
public static async Task<string> ReadResourceAsStringAsync(this Assembly assembly, string resourceName)
|
||||||
{
|
{
|
||||||
|
resourceName = assembly.GetName().Name + "." + resourceName.Replace('/', '.');
|
||||||
|
|
||||||
using (var resourceStream = assembly.GetManifestResourceStream(resourceName))
|
using (var resourceStream = assembly.GetManifestResourceStream(resourceName))
|
||||||
{
|
{
|
||||||
using (var streamReader = new StreamReader(resourceStream))
|
using (var streamReader = new StreamReader(resourceStream))
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,8 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
|
|
||||||
private static Stream GetResourceStream(string resourceName)
|
private static Stream GetResourceStream(string resourceName)
|
||||||
{
|
{
|
||||||
|
resourceName = "Microsoft.AspNet.Mvc.Razor.Host.Test." + resourceName.Replace('/', '.');
|
||||||
|
|
||||||
var assembly = typeof(MvcRazorHostTest).Assembly;
|
var assembly = typeof(MvcRazorHostTest).Assembly;
|
||||||
return assembly.GetManifestResourceStream(resourceName);
|
return assembly.GetManifestResourceStream(resourceName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace FilesWebSite
|
||||||
{
|
{
|
||||||
return new FilePathResult("/Greetings.txt", "text/plain")
|
return new FilePathResult("/Greetings.txt", "text/plain")
|
||||||
{
|
{
|
||||||
FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "EmbeddedResources"),
|
FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "FilesWebSite.EmbeddedResources"),
|
||||||
FileDownloadName = "downloadName.txt"
|
FileDownloadName = "downloadName.txt"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace RazorEmbeddedViewsWebSite
|
||||||
|
|
||||||
services.Configure<RazorViewEngineOptions>(options =>
|
services.Configure<RazorViewEngineOptions>(options =>
|
||||||
{
|
{
|
||||||
options.FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "EmbeddedResources");
|
options.FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "RazorEmbeddedViewsWebSite.EmbeddedResources");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue