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.

Allow setting MSBuild target via MSBuildSettings using a string

See original GitHub issue

Currently when calling the MSBuild alias with an MSBuildSettings, we need to set the target using the WithTarget extension method.

MSBuild("./my-app.sln", new MSBuildSettings
{
    Configuration = "Release",
    ToolVersion = MSBuildToolVersion.VS2019,
}.WithTarget("Build")); // <<<###

It would be nice if we could use a property, with a string, which would make it more natural when using properties for everything else:

MSBuild("./my-app.sln", new MSBuildSettings
{
    Target = "Build",  // <<<###
    Configuration = "Release",
    ToolVersion = MSBuildToolVersion.VS2019,
});

This property should also understand semicolons as separator for multiple targets and call Targets.Add accordingly.

MSBuild("./my-app.sln", new MSBuildSettings
{
    Target = "Clean;Build",  // <<<###
    Configuration = "Release",
    ToolVersion = MSBuildToolVersion.VS2019,
});

What version of Cake are you using?

1.0.0-rc0001

Would you be willing to send a PR?

Yes!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
augustoproietecommented, Sep 7, 2021

@MariaSolOs It’s exactly what the error message says. Your documentation comments have trailing spaces on them that should be removed.

e.g. image

0reactions
cake-build-botcommented, Oct 14, 2022

🎉 This issue has been resolved in version v2.3.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

API - MSBuildSettings Class
Name Value Summary SetVersion(string) MSBuildSettings Sets the version. From MSBuildSettingsExte... WithToolPath(FilePath) T Sets the tool path. From ToolSettingsExtensi... WithToolTimeout(TimeSpan) T Sets the tool timeout. From ToolSettingsExte......
Read more >
Cake MSBuild Targets
The WithTarget extension method returns the same instance of the MSBuildSettings with the modifications, it doesn't interact with the current ...
Read more >
MSBuild Command-Line Reference
Learn how to use MSBuild.exe command line to build specific targets of specific projects in solutions. Building Multiple Projects in Parallel ...
Read more >
Building Applications using Command Line
The MSBuildSettings.xml file consists of all the build details to build and clean the AB Suite application. You can modify the value of...
Read more >
Documentation - Compiler Options in MSBuild
Overview. When you have an MSBuild based project which utilizes TypeScript such as an ASP.NET Core project, you can configure TypeScript in two...
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