最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

嘗試讓 powershell 在 C#/Visual Studio 中工作

嘗試讓 powershell 在 C#/Visual Studio 中工作

PHP
米琪卡哇伊 2024-01-20 16:14:50
我試圖學(xué)習(xí)如何在 C# 中使用 powershell 我正在遵循本教程但是,當(dāng)我運(yùn)行它時(shí),我收到此錯(cuò)誤:未處理的異常。System.InvalidProgramException:公共語(yǔ)言運(yùn)行時(shí)檢測(cè)到無(wú)效程序。在 C:\Users\ncox\source\repos\desktopAdmin365\Program.cs 中的 DesktopAdmin365.Program.Main(String[] args) 處的 System.Management.Automation.PowerShell.Create() 處:第 11 行C:\Users\ncox\source\repos\desktopAdmin365\bin\Debug\netcoreapp3.0\desktopAdmin365.exe(進(jìn)程17464)退出,代碼為-532462766。我確信在包含解決方案資源管理器中的引用/依賴項(xiàng)時(shí)我錯(cuò)過(guò)了一些東西,但我沒有運(yùn)氣通過(guò)谷歌找出哪一個(gè)這是代碼using System;using System.Management.Automation;using System.Collections.ObjectModel;namespace desktopAdmin365{    class Program    {        static void Main(string[] args)        {            using (PowerShell PowerShellInstance  = PowerShell.Create())            {                 PowerShellInstance.AddScript("param($param1) $d = get-date; $s = 'test string value'; " +                "$d; $s; $param1; get-service");            }        }    }}
查看完整描述

1 回答

?
烙印99

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超13個(gè)贊

如果您查看項(xiàng)目中的依賴項(xiàng),您可能會(huì)看到一條有關(guān)使用 .NETFramework 恢復(fù)包且可能不兼容的警告。

您的項(xiàng)目是.NET core,因此您可能需要安裝Powershell Core。

或者,切換到 .net 框架解決方案,它將起作用。


查看完整回答
反對(duì) 回復(fù) 2024-01-20
  • 1 回答
  • 0 關(guān)注
  • 179 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)