Cannot convert from 'Cake.Common.Tools.MSBuild.MSBuildSettings' to 'Cake.Common.Tools.DotNetBuildSettings'
See original GitHub issueSteps 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:
- Created 7 years ago
- Comments:11 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@devlead Same error, slightly different error message:
I would however call this an compiler issue. It may be solved by moving DotNetBuildSettings (and aliases) to another namespace than Cake.Common.Tools
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