也许我对".NET核心库"的含义缺乏了解,但是当我尝试使用Visual Studio 2015在.NET 4.6程序集中添加.NET核心库时,我收到错误:
无法添加对"..."的引用.
我明白了什么问题吗?
这是我在.NET Core程序集的project.json中配置的
"frameworks": {
"net451": { },
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Runtime": "4.0.21-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用二进制Cmdlet内部创建一个基本的PowerShell模块,因为在PowerShell中编写内容只是看起来不像在C#中那样方便.
按照本指南,看起来我必须:
project.jsonRootModule我的目标.dll.dll附近的清单PSModulePath但是,当我尝试时Import-Module,PowerShell核心抱怨缺少运行时:
Import-Module : Could not load file or assembly 'System.Runtime, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system
cannot find the file specified.
At line:1 char:1
Run Code Online (Sandbox Code Playgroud)
我做错了什么,或者还不支持这些棘手的事情?