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.

MSBuild could have an opt-in mode that would apply rules and heuristics to give suggestions about project “health”.

Possible warnings:

  • You have something that is almost an item transform but not well formed so falls back to string (like @(I->'%(Identity)) with a missing closing ').
  • You have referred to a property that is not defined and it expanded to the empty string.
  • You have referred to a property that is not defined, but an item of the same name is defined.
  • You have referred to an item that is not defined, but a property of the same name is defined.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:6
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
stan-szcommented, Nov 29, 2021

My favorite linter rule would be to catch ItemGroups with wildcards that scan the entire drive:

<ItemGroup>
  <MyItem Include="$(SomeProperty)/**" />
</ItemGroup>

Where SomeProperty resolves to empty sting.

0reactions
hknielsencommented, Aug 2, 2023

We had an interesting issue today in our team, where:

<ProjectReference...><Properties></Properties>

Broke Publishing, and was not trivial what was happening, until we remembered that ProjectReference mapped to MsBuild task and removed the Properties delegated trough, removing the TargetFramework.

Interesting case as well for a linter warning, suggest to use AdditinalProperties instead

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a lint-like tool for MSBuild?
Is there a tool that can check an MSBuild file for internal consistency and highlight missing configurations along the lines of "your project ......
Read more >
MSBuild linter · Issue #1777
MSBuild could have an opt-in mode that would apply rules and heuristics to give suggestions about project "health". Possible warnings:.
Read more >
FSharpLint | Setup MSBuild Task
Setup MSBuild Task. FSharpLint can be run as an MSBuild task; this will result in lint warnings showing up in your IDE (Visual...
Read more >
What is the best linter for C#? : r/dotnet
42 votes, 41 comments. I'm looking for something to standardize code formatting in a few projects (ASP.NET Core and some console apps).
Read more >
Use MSBuild to convert Bicep to JSON - Azure
This article describes how to use MSBuild to convert a Bicep file to Azure Resource Manager template (ARM template) JSON.
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