Fixing load of ALC.dll so it is only included in the TPA list once for side-by-side scenarios.
This commit is contained in:
parent
640755f7da
commit
0544bc2baf
1 changed files with 17 additions and 4 deletions
|
@ -1355,14 +1355,27 @@ namespace NativeMsh
|
||||||
LPCSTR vals[nMaxProps];
|
LPCSTR vals[nMaxProps];
|
||||||
int nProps = 0;
|
int nProps = 0;
|
||||||
|
|
||||||
// If I do not include my managed enload point dll in this list, I get a security error.
|
// The TPA list is the required list of CoreCLR assemblies that comprise
|
||||||
|
// the trusted platform upon which PowerShell will run.
|
||||||
std::stringstream assemblyList;
|
std::stringstream assemblyList;
|
||||||
bool listEmpty = true;
|
bool listEmpty = true;
|
||||||
this->GetTrustedAssemblyList(hostEnvironment.GetCoreCLRDirectoryPath(), assemblyList, listEmpty);
|
this->GetTrustedAssemblyList(hostEnvironment.GetCoreCLRDirectoryPath(), assemblyList, listEmpty);
|
||||||
|
|
||||||
char coreCLRPowerShellExtInstallPath[MAX_PATH];
|
// Fall back to attempt to load the CLR from the inbox location if
|
||||||
::ExpandEnvironmentStringsA(coreCLRPowerShellExtInstallDirectory, coreCLRPowerShellExtInstallPath, MAX_PATH);
|
// the configuration file pointed to an invalid directory.
|
||||||
this->GetTrustedAssemblyList(coreCLRPowerShellExtInstallPath, assemblyList, listEmpty);
|
if (listEmpty)
|
||||||
|
{
|
||||||
|
char coreCLRPowerShellExtInstallPath[MAX_PATH];
|
||||||
|
::ExpandEnvironmentStringsA(coreCLRPowerShellExtInstallDirectory, coreCLRPowerShellExtInstallPath, MAX_PATH);
|
||||||
|
this->GetTrustedAssemblyList(coreCLRPowerShellExtInstallPath, assemblyList, listEmpty);
|
||||||
|
}
|
||||||
|
if (listEmpty)
|
||||||
|
{
|
||||||
|
// No CoreCLR assemblies were found in either location. There is no
|
||||||
|
// point in continuing.
|
||||||
|
this->output->DisplayMessage(false, g_STARTING_CLR_FAILED, GetLastError());
|
||||||
|
return EXIT_CODE_INIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
props[nProps] = "TRUSTED_PLATFORM_ASSEMBLIES";
|
props[nProps] = "TRUSTED_PLATFORM_ASSEMBLIES";
|
||||||
std::string tempStr = assemblyList.str();
|
std::string tempStr = assemblyList.str();
|
||||||
|
|
Loading…
Reference in a new issue