5

Maybe simple question however I'm stuck. I try to configure cake script. I'm using the following script

Task("Build")
    .Description("Builds the Solution")
    .Does(() =>
    {
        MSBuild(SOLUTION_FILE, CreateSettings());
    });

MSBuildSettings CreateSettings()
{
    var settings = new MSBuildSettings { Verbosity = Verbosity.Minimal, Configuration = "Debug" };
    settings.WithProperty("DebugType", "pdbonly");
    settings.ToolVersion = MSBuildToolVersion.VS2017;
    return settings;
}

When I execute it. I have the following issue:

========================================
Build
========================================
An error occurred when executing task 'Build'.

I have added MsBuild path to PATH environment but still not working. How can i set custom MsBuild path ?

Thanks

Marcus X
  • 95
  • 1
  • 6
  • 1
    Can you try the following: https://stackoverflow.com/questions/38658660/how-to-enable-diagnostic-verbosity-for-cake – Gary Ewan Park Nov 09 '18 at 19:32
  • Thanks. We have the following issue Cake.Core.CakeException: MSBuild: Could not locate executable. It's strange – Marcus X Nov 09 '18 at 19:39
  • 2
    Due to the way in which MSBuild is now located in different places on the file system, based on what edition of Visual Studio you are using, it may be necessary for you to use VSWhere to locate it. This is documented here: https://cakebuild.net/blog/2017/03/vswhere-and-visual-studio-2017-support – Gary Ewan Park Nov 09 '18 at 19:45

0 Answers0