![](/img/trans.png)
[英]Azure PowerShell - Object reference not set to an instance of an object
[英]PowerShell imported dll not working: Exception calling “ReadLookupTables” with “0” argument(s): "Object reference not set to an instance of an object
我目前已開發的Powershell腳本存在問題。 以下腳本在我的系統和另一台開發人員計算機上運行,但不在任何其他系統上運行...我已經在虛擬Win10 hyper v上對其進行了測試,但始終是相同的錯誤:
使用“ 0”參數調用“ ReadLookupTables”的異常:“對象引用未設置為對象的實例。
腳本代碼:
$pwaUrl = "https://xyz.co"
$userName = "xyz"
$password = "xyz"
Import-Module "$PSScriptRoot\ProjectHelper\Microsoft.ProjectServer.dll"
$projHelper = New-Object Microsoft.ProjectServer.MsProject($pwaUrl, $username, $password, $true)
$secSvc = $projHelper.GetSecuritySvc();
$secGroups = $secSvc.readGroupList();
$secGroups
在開發人員機器上安裝了Visual Studio Enterprise ...我在虛擬機上添加了所有SDK和.Net Runtime環境,但是它不起作用。
感謝幫助
我已經找到解決問題的方法。
我已經使用Microsoft dll反匯編程序打開了dll,並在清單上檢查了該dll所需的dll ...比起我將我的系統上的dll與其他系統進行比較,然后將丟失的文件復制到“ $ PSScriptRoot \\ ProjectHelper \\ Microsoft.ProjectServer.dll”文件夾
現在正在工作...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.