Move away from `Assembly.Load` to Assembly.LoadFile

- Fixes build break.
This commit is contained in:
N. Taylor Mullen 2017-05-26 12:12:03 -07:00
Родитель ab64769c59
Коммит 8c822a8e77
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -33,10 +33,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests
};
var expectedText = "Hello Index!";
var assemblyPath = Path.Combine(
Fixture.DeploymentResult.DeploymentParameters.PublishedApplicationRootPath,
$"{ApplicationName}.PrecompiledViews.dll");
// Act - 1
var response1 = await Fixture.HttpClient.GetStringWithRetryAsync(
"Home/Index",

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Reflection;
using Microsoft.AspNetCore.Mvc;
@ -13,8 +14,10 @@ namespace PublishWithEmbedViewSources.Controllers
public string GetPrecompiledResourceNames()
{
var precompiledAssembly = Assembly.Load(
new AssemblyName("PublishWithEmbedViewSources.PrecompiledViews"));
var precompiledAssemblyPath = Path.Combine(
Path.GetDirectoryName(GetType().Assembly.Location),
"PublishWithEmbedViewSources.PrecompiledViews.dll");
var precompiledAssembly = Assembly.LoadFile(precompiledAssemblyPath);
return string.Join(
Environment.NewLine,
precompiledAssembly.GetManifestResourceNames());