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.

Microsoft.Build.NoTargets project expects incorrect ouput

See original GitHub issue

Visual Studio Version: 16.4.4

Summary: Having a project with Microsoft.Build.NoTargets is never up-to-date because it expects an output that is never generated.

Steps to Reproduce:

  1. Create and SDK project.

  2. Update the project to be Microsoft.Build.NoTargets. See mine:

<Project Sdk="Microsoft.Build.NoTargets">
  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
  </PropertyGroup>
</Project>

I also had to add the following global.json:

{
  "msbuild-sdks": {
    "Microsoft.Build.NoTargets": "1.0.85"
  }
}
  1. Build twice

Expected Behavior: The project should be up to date.

Actual Behavior: The project is not up to date because it expects the pdb file. Here is the log:

1>FastUpToDate: Adding UpToDateCheckBuilt outputs: (RepoNoTargetsBug)
1>FastUpToDate:     'C:\Users\edgarsil.000\source\repos\RepoNoTargetsBug\RepoNoTargetsBug\obj\Debug\net472\RepoNoTargetsBug.pdb' (RepoNoTargetsBug)
1>FastUpToDate: Output 'C:\Users\edgarsil.000\source\repos\RepoNoTargetsBug\RepoNoTargetsBug\obj\Debug\net472\RepoNoTargetsBug.pdb' does not exist, not up to date. (RepoNoTargetsBug)

User Impact: Project is never up to date.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
davkeancommented, Feb 4, 2020

@edgarrs Thanks for the bug, I’ve moved it over to https://github.com/microsoft/MSBuildSdks/issues/148 as they own this, thanks.

0reactions
NoneGivencommented, Feb 17, 2020

@edgarrs You can enclose inline code in backticks and code blocks in triple backticks. You can even specify the language with triple backticks.

<Project Sdk="Microsoft.Build.NoTargets">
  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
  </PropertyGroup>
</Project>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft.Build.NoTargets project expects incorrect ouput
Having a project with Microsoft.Build.NoTargets is never up-to-date because it expects an output that is never generated. Steps to Reproduce:.
Read more >
NoTargets
ProjectReferences do not work for a NoTargets project that sets TargetFrameworks and NoTargetsDoNotReferenceOutputAssemblies #469 opened by ericstj.
Read more >
Using Microsoft.Build.NoTargets getting ucrt path
I have created an msbuild project which uses Microsoft.Build.NoTargets and I need to import C:\Program Files (x86)\Windows ...
Read more >
MSBuild Targets
A target element can have both Inputs and Outputs attributes, indicating what items the target expects as input, and what items it produces...
Read more >
NuGet pack and restore as MSBuild targets
$(OutputPath) is relative and expects that you are running the command from the project root. pack target. For .NET projects that use the ......
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