어셈블리를 참조 할 필요가 :추가 형을 CS에서, 나는 아주 간단한 코드와 CS 파일을 HAVA
using Ionic.Zip;
public static class Helper
{
public static ZipFile GetNewFile(string fileName)
{
return new ZipFile(fileName);
}
}
그것은 Ionic.Zip 조립이 필요합니다. 나는이 작업을 수행 할 때
cd c:\pst
Add-Type -Path "2.cs" -ReferencedAssemblies "Ionic.Zip.dll"
$var = [Helper]::GetNewFile("aaa")
가 나에게 제공합니다 :이처럼 내 파워 쉘이 유형을 추가 할
The following exception occurred while retrieving member "GetNewFile": "Could not load file or assembly 'Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of its dependencies. The located assembly'
s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
일부 임시 위치에 어셈블리를 컴파일 한 것으로 보인다는 찾을 수 없습니다 이온 .Zip 거기. 출력 어셈블리의 사용을 방지 할 수있는 방법이 있는지 그래서 궁금하네요
cd c:\pst
Add-Type -Path "2.cs" -ReferencedAssemblies "Ionic.Zip.dll" -OutputAssembly "T.dll"
Add-Type -Path "T.dll"
$var = [Helper]::GetNewFile("aaa")
$var.AlternateEncoding
: 출력 어셈블리를 지정한 다음이 어셈블리를 추가하는 경우
그것은, 그러나, 작동?
다른 옵션이지만,이 작업을 수행하고 싶지 않습니다. –
미안하지만 다른 사람들에게이 작업을 수행하는 방법을 알지 못합니다. –