Targeting multiple frameworks with Cake script

醉酒当歌 提交于 2019-12-06 08:46:31

Yes Cake fully supports building VS2017 projects both using latest .NET SDK 1.0.4 and MSBuild 15.x.

Cake itself is built using Cake, VS2017 and .NET Core SDK 1.0.4 https://github.com/cake-build/cake

When using MSBuild alias make sure you're using correct version of MSBuild by setting Tool version to MSBuildToolVersion.VS2017.

MSBuild("./src/Cake.sln", 
    new MSBuildSettings { ToolVersion = MSBuildToolVersion.VS2017
});

If you've got VS2017 installed in a non standard location, then you can use the VSWhere tool and alias to locate correct MSBuild path

#tool nuget:?package=vswhere 

DirectoryPath vsLatest = VSWhereLatest();

FilePath msBuildPathX64 = (vsLatest==null) ? null : vsLatest.CombineWithFilePath("./MSBuild/15.0/Bin/amd64/MSBuild.exe"); 

MSBuild("./src/Example.sln", 
    new MSBuildSettings { ToolPath = msBuildPathX64
}); 

Read more about this at: http://cakebuild.net/blog/2017/03/vswhere-and-visual-studio-2017-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!