I hava a ccs file with very brief Code:
using Ionic.Zip;
public static class Helper
{
public static ZipFile GetNewFile(string fileName)
{
return new ZipFile(fileName);
}
}
它需要一站式。 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)"
它似乎在一些温带汇编了组装,并且可以发现一流。 在那里。
但是,如果具体指明产出组,然后添加这一组:
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
因此,我很想知道是否有办法避免使用产出组?