我想使用工具“Cake”构建我的解决方案,但我遇到了一个问题。我无法将 Microsoft.Windows.SDK.Contracts Nuget 包添加到项目中。我使用这个命令:
#addin nuget:?package=Microsoft.Windows.SDK.Contracts&version=10.0.19041.1&loaddependencies=true
我得到错误
C:\sen_cake\ble-module\Module.BLE\Plugin.BLE\Core\BluetoothLE.cs(11,15): error CS0234: The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) [C:\sen_cake\ble-module\Module.BLE\Plugin.BLE\Plugin.BLE.csproj]
我所有的 build.cake 文件:
#addin nuget:?package=Microsoft.Windows.SDK.Contracts&version=10.0.19041.1&loaddependencies=true
var target = Argument("target", "Build");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// TASKS
/////////////////////////////////////////////////////////////////////
Task("Build")
.Does(() =>
{
DotNetCoreBuild("../Module.BLE/Module.BLE.sln", new DotNetCoreBuildSettings
{
Configuration = configuration,
});
});
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);