question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot convert from 'Cake.Common.Tools.MSBuild.MSBuildSettings' to 'Cake.Common.Tools.DotNetBuildSettings'

See original GitHub issue

Steps to reproduce:

Task("Default")
    .Does(() => 
{
    new MSBuildSettings()
        .WithProperty("foobar", MakeAbsolute(Directory(".")));

});

This will output error message:

error CS1929: Instance argument: cannot convert from 'Cake.Common.Tools.MSBuild.MSBuildSettings' to 'Cake.Common.Tools.DotNetBuildSettings'

Workaround add ToString()

Task("Default")
    .Does(() => 
{
    new MSBuildSettings()
        .WithProperty("foobar", MakeAbsolute(Directory(".")).ToString());

});

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
bjorkstrommcommented, Apr 28, 2016

@devlead Same error, slightly different error message:

error CS1929: 'MSBuildSettings' does not contain a definition for 'WithProperty' and the best 
extension method overload 'DotNetBuildSettingsExtensions.WithProperty(DotNetBuildSettings, 
string, params string[])' requires a receiver of type 'DotNetBuildSettings'

I would however call this an compiler issue. It may be solved by moving DotNetBuildSettings (and aliases) to another namespace than Cake.Common.Tools

0reactions
bjorkstrommcommented, May 19, 2020

DotNetBuild was obsoletet here https://github.com/cake-build/cake/issues/1796 and will be removed with this issue https://github.com/cake-build/cake/issues/2292

Read more comments on GitHub >

github_iconTop Results From Across the Web

API - DotNetBuildSettings.MSBuildSettings Property
DotNetBuildSettings. MSBuildSettings Property. Summary. Gets or sets additional arguments to be passed to MSBuild. Namespace: Cake.Common.Tools.DotNet.
Read more >
Cannot convert from 'Cake.Common.Tools.MSBuild. ...
Cannot convert from 'Cake.Common.Tools.MSBuild.MSBuildSettings' to 'Cake.Common.Tools.DotNetBuildSettings'
Read more >
Targeting multiple frameworks with Cake script
This seems to have broken my script as I get the following error when using the Cake MSBuild alias (http://cakebuild.net/api/Cake.Common.Tools.
Read more >
Using Cake build scripts for your .NET Core web apps
Cake is a build automation system for .NET Developers to script their build processes using a C# Domain Specific Language (DSL).
Read more >
Cake build - Specify MSBuild version to be used for build
Solution for the error. I had to find the line in the script where MSBuild was being called. It looked somewhat like below....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found