0
什麼是存儲System.Collections.Generic的程序集的全限定名?System.Collections.Generic完全限定名
我有這樣的代碼:
Add-Type -AssemblyName "System.XML.Linq"
Add-Type -AssemblyName "System.Collections.Generic"
的LINQ被添加正常,但是我得到這個錯誤System.Collections.Generic:
Add-Type : Cannot add type. The assembly 'System.Collections.Generic' could not be found.
How do I use Add-Type to load Microsoft.Web.Deployment?說,使用完全合格的名稱,例如: :
Add-Type -AssemblyName ('Microsoft.Web.Deployment, Version=7.1.0.0, ' +
'Culture=neutral, PublicKeyToken=31bf3856ad364e35')
我怎樣才能找出完全合格的名字是什麼?
如果我需要在不同的計算機上運行腳本,該怎麼辦? 公鑰標記會不同嗎? –
我可以看到C:\ Windows \ assembly \ GAC_MSIL沒有System.Collections.Generic的文件夾。 我需要下載此庫嗎? –
您錯過了在Bing或Google上查找感興趣的命名空間的步驟。選擇你正在使用的類型 - 說辭典。上面的鏈接在我的答案中。在主題頂部,它會顯示「Assembly:」,並指明類型所在的程序集。如果是mscorlib.dll,System.dll或System.Core.dll,則無需執行任何操作將始終由PowerShell加載。 –