*/
bool deps_resolver_t::resolve_tpa_list(
pal::string_t* output,
- std::unordered_set<pal::string_t>* breadcrumb)
+ std::unordered_set<pal::string_t>* breadcrumb,
+ bool ignore_missing_assemblies)
{
const std::vector<deps_entry_t> empty(0);
name_to_resolved_asset_map_t items;
return true;
}
- return report_missing_assembly_in_manifest(entry);
+ return report_missing_assembly_in_manifest(entry, ignore_missing_assemblies);
}
else
{
// Entrypoint to resolve TPA, native and resources path ordering to pass to CoreCLR.
//
// Parameters:
-// app_root - The application local directory
-// package_dir - The directory path to where packages are restored
-// package_cache_dir - The directory path to secondary cache for packages
-// clr_dir - The directory where the host loads the CLR
// probe_paths - Pointer to struct containing fields that will contain
// resolved path ordering.
+// breadcrumb - set of breadcrumb paths - or null if no breadcrumbs should be collected.
+// ignore_missing_assemblies - if set to true, resolving TPA assemblies will not fail if an assembly can't be found on disk
+// instead such entry will simply be ignored.
//
//
-bool deps_resolver_t::resolve_probe_paths(probe_paths_t* probe_paths, std::unordered_set<pal::string_t>* breadcrumb)
+bool deps_resolver_t::resolve_probe_paths(probe_paths_t* probe_paths, std::unordered_set<pal::string_t>* breadcrumb, bool ignore_missing_assemblies)
{
- if (!resolve_tpa_list(&probe_paths->tpa, breadcrumb))
+ if (!resolve_tpa_list(&probe_paths->tpa, breadcrumb, ignore_missing_assemblies))
{
return false;
}
bool resolve_probe_paths(
probe_paths_t* probe_paths,
- std::unordered_set<pal::string_t>* breadcrumb);
+ std::unordered_set<pal::string_t>* breadcrumb,
+ bool ignore_missing_assemblies = false);
void init_known_entry_path(
const deps_entry_t& entry,
// Resolve order for TPA lookup.
bool resolve_tpa_list(
pal::string_t* output,
- std::unordered_set<pal::string_t>* breadcrumb);
+ std::unordered_set<pal::string_t>* breadcrumb,
+ bool ignore_missing_assemblies);
// Resolve order for culture and native DLL lookup.
bool resolve_probe_dirs(
// doesn't guarantee that they will actually execute.
probe_paths_t probe_paths;
- if (!resolver.resolve_probe_paths(&probe_paths, nullptr))
+ if (!resolver.resolve_probe_paths(&probe_paths, nullptr, /* ignore_missing_assemblies */ true))
{
return StatusCode::ResolverResolveFailure;
}
.Execute()
.StdErrAfter("corehost_resolve_component_dependencies = {")
.Should().Pass()
- .And.HaveStdOutContaining("corehost_resolve_component_dependencies:Fail[0x8000808C]")
- .And.HaveStdErrContaining("An assembly specified in the application dependencies manifest (ComponentWithDependencies.deps.json) was not found:");
+ .And.HaveStdOutContaining("corehost_resolve_component_dependencies:Success")
+ .And.HaveStdOutContaining(
+ $"corehost_resolve_component_dependencies assemblies:[" +
+ $"{componentFixture.TestProject.AppDll}{Path.PathSeparator}" +
+ $"{Path.Combine(componentFixture.TestProject.OutputDirectory, "Newtonsoft.Json.dll")}{Path.PathSeparator}]");
}
[Fact]