找不到类型[Newtonsoft.Json.Linq.JObject]

时间:2018-06-06 21:19:27

标签: linq powershell

我使用安装模块 Install-Module -Name newtonsoft.json 即便如此,它也显示错误。我甚至试过Add-Type -AssemblyName Newtonsoft.Json.Linq.JObject没有任何效果。求救!

PS C:\Users\m-00261-2>   `$rawJson = [Newtonsoft.Json.Linq.JObject]::Parse($rawString)`
Unable to find type [Newtonsoft.Json.Linq.JObject].
At line:1 char:14
+   $rawJson = [Newtonsoft.Json.Linq.JObject]::Parse($rawString)
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Newtonsoft.Json.Linq.JObject:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound


PS C:\Users\m-00261-2> `Add-Type -AssemblyName Newtonsoft.Json.Linq.JObject`
Add-Type : Cannot add type. The assembly 'Newtonsoft.Json.Linq.JObject' could not be found.
At line:1 char:1
+ Add-Type -AssemblyName Newtonsoft.Json.Linq.JObject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Newtonsoft.Json.Linq.JObject:String) [Add-Type], Exception
    + FullyQualifiedErrorId : ASSEMBLY_NOT_FOUND,Microsoft.PowerShell.Commands.AddTypeCommand

0 个答案:

没有答案