2
我想用我自己的基礎對象和我的列表中的一些特殊功能來構建特定列表。 它作爲一個EXE很好。但是,當我嘗試在PowerShell中導入等效的DLL時不起作用。在派生類的PowerShell中構建自定義類型
add-type @"
using System.Collections.Generic;
namespace myTest
{
public class stuff
{
public int val;
public stuff(int val)
{
this.val = val;
}
}
public class tata : List<stuff>
{
int val ;
..
}
}
"@
而調用類:
$example = new-object myTest.stuff ->Works
$example2 = new-object myTest.tata ->Does not work
我不能intanciate myTest.tata但類型似乎聲明。 看來,問題來自
public class tata: List<stuff>
東西在PowerShell中無法解釋這一行
是否有人有同樣的問題,解決這個問題?