Move away from `Assembly.Load` to Assembly.LoadFile
- Fixes build break.
This commit is contained in:
parent
ab64769c59
commit
8c822a8e77
|
|
@ -33,10 +33,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests
|
||||||
};
|
};
|
||||||
var expectedText = "Hello Index!";
|
var expectedText = "Hello Index!";
|
||||||
|
|
||||||
var assemblyPath = Path.Combine(
|
|
||||||
Fixture.DeploymentResult.DeploymentParameters.PublishedApplicationRootPath,
|
|
||||||
$"{ApplicationName}.PrecompiledViews.dll");
|
|
||||||
|
|
||||||
// Act - 1
|
// Act - 1
|
||||||
var response1 = await Fixture.HttpClient.GetStringWithRetryAsync(
|
var response1 = await Fixture.HttpClient.GetStringWithRetryAsync(
|
||||||
"Home/Index",
|
"Home/Index",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
|
@ -13,8 +14,10 @@ namespace PublishWithEmbedViewSources.Controllers
|
||||||
|
|
||||||
public string GetPrecompiledResourceNames()
|
public string GetPrecompiledResourceNames()
|
||||||
{
|
{
|
||||||
var precompiledAssembly = Assembly.Load(
|
var precompiledAssemblyPath = Path.Combine(
|
||||||
new AssemblyName("PublishWithEmbedViewSources.PrecompiledViews"));
|
Path.GetDirectoryName(GetType().Assembly.Location),
|
||||||
|
"PublishWithEmbedViewSources.PrecompiledViews.dll");
|
||||||
|
var precompiledAssembly = Assembly.LoadFile(precompiledAssemblyPath);
|
||||||
return string.Join(
|
return string.Join(
|
||||||
Environment.NewLine,
|
Environment.NewLine,
|
||||||
precompiledAssembly.GetManifestResourceNames());
|
precompiledAssembly.GetManifestResourceNames());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue