PowerShell 원격 세션에서 파일 또는 어셈블리를로드 할 수 없습니다.

안드레아스

PowerShell 원격 세션에서 어셈블리를 실행하려고하면이 오류가 발생합니다.

Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find
the file specified.

원격 세션을 시작했습니다.

Enter-PsSession -ComputerName myComputer -ConfigurationName Microsoft.Powershell
-Credential domain\user

그러나 동일한 사용자와 동일한 컴퓨터에서 실행하면 문제가 없습니다.

최신 정보:

나는 뭔가를하고 싶다.

if (Test-Path $AssemblyPath) {
    $fileStream = ([System.IO.FileInfo] (Get-Item $AssemblyPath)).OpenRead()
    $assemblyBytes = New-Object byte[] $fileStream.Length
    $fileStream.Read($assemblyBytes, 0, $fileStream.Length) | Out-Null
    $fileStream.Close()
    $assemblyLoaded = [System.Reflection.Assembly]::Load($assemblyBytes) | Out-Null

    $myObject = New-Object namespaceInMyAssembly.ClassInMyAssembly
    $myObject.doMyAction()
}
안드레아스

문제를 발견했습니다. Powershell이 ​​powershell.exe.config에서 .Net 4 용으로 구성되었지만 wsmprovhost.exe.config에서는 구성되지 않았습니다. 그래서 원격 세션에서 .Net 4 어셈블리를로드 할 수 없습니다. 이 질문을 참조하십시오 .

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

.Net Core에서 Powershell 실행-파일 또는 어셈블리를로드 할 수 없습니다. Microsoft.Management.Infrastructure

릴리스 모드에서 Visual Studio "파일 또는 어셈블리를로드 할 수 없습니다. 작업이 지원되지 않습니다."오류

파일 또는 어셈블리를로드 할 수 없습니다. 작업이 지원되지 않습니다. (HRESULT에서 예외 : 0x80131515)

AWS Lambda의 .net 코어에서 파일 또는 어셈블리 'AWSSDK.Core를로드 할 수 없습니다.

CRM에서 파일 또는 어셈블리를 프로젝트에로드 할 수 없습니다.

Solidworks 애드 인에서 파일 또는 어셈블리를로드 할 수 없습니다.

PowerShell에서 WinSCP로드-파일 또는 어셈블리를로드 할 수 없음-이 어셈블리는 현재로드 된 런타임보다 최신 런타임에 의해 빌드되었습니다.

WP8.1 응용 프로그램에서 파일 또는 어셈블리를로드 할 수 없습니다.

Microsoft.Owin 3.0.0에서 3.0.1로 파일 또는 어셈블리를로드 할 수 없습니다.

SSIS 웹 서비스 작업에서 파일 또는 어셈블리 오류를로드 할 수 없습니다.

Visual Studio 2019 16.2에서 파일 또는 어셈블리 Microsoft.VisualStudio.Coverage.Analysis를로드 할 수 없습니다.

DotNetNuke에서 파일 또는 어셈블리 EntityFramework를로드 할 수 없습니다.

Sitecore 8.1 Project에서 Microsoft.Extensions.DependencyInjection.Abstractions 파일 또는 어셈블리를로드 할 수 없습니다.

Azure Functions 앱에서 파일 또는 어셈블리 Microsoft.EntityFrameworkCore 오류를로드 할 수 없습니다.

Visual Studio에서 파일 또는 어셈블리 오류를로드 할 수 없습니다.

WCF 서비스를 사용하여 파일 또는 어셈블리를로드 할 수 없습니다.

Azure에 배포 한 후 파일 또는 어셈블리 'System.IdentityModel.Tokens.Jwt를로드 할 수 없습니다.

파일 또는 어셈블리 Devart.Data를로드 할 수 없습니다.

파일 또는 어셈블리 mongocrypt를로드 할 수 없습니다.

파일 또는 어셈블리 Microsoft.CodeAnalysis를로드 할 수 없습니다.

.NET Core-파일 또는 어셈블리를로드 할 수 없습니다.

System.BadImageFormatException : 파일 또는 어셈블리를로드 할 수 없습니다.

파일 또는 어셈블리 Windows.winmd를로드 할 수 없습니다. '

파일 또는 어셈블리 'DotNetOpenAuth.Core를로드 할 수 없습니다.

ClosedXML-파일 또는 어셈블리를로드 할 수 없습니다.

파일 또는 어셈블리를로드 할 수 없습니다.

파일 또는 어셈블리 'MySql.Data를로드 할 수 없습니다.

파일 또는 어셈블리 'LogicNP.ShellObjects'를로드 할 수 없습니다.

파일 또는 어셈블리를 로드할 수 없습니다.