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.

NB.GV defeats incremental build for .NET SDK style WPF projects

See original GitHub issue

Nerdbank gitversion is incompatible with WPF targets and SDK projects. Either ThisAssembly will be inaccessible due to protection level, or the generation of Version.cs in the WPF temp project breaks incremental build.

From my investigation, I believe 3 things are needed:

  1. Make GenerateAssemblyVersionInfo run before MarkupCompilePass1
  2. Do not run GenerateAssemblyVersionInfo inside the WPF temporary project.
  3. Re-include the Version.cs generated from the original project in the WPF temporary project.

See https://devdiv.visualstudio.com/DevDiv/VS IDE CPS/_git/CPS/pullrequest/120052?_a=overview for the workarounds I performed to get this to work.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
clairernovotnycommented, May 18, 2018

@AArnott FWIW, the SDK Extras 1.5.4 includes a fix for the WPF imports stuff based on a new variable they set.

0reactions
jviaucommented, May 2, 2018

I updated my comment above. I debugged into MarkupCompilePass1, and its incremental build check always failed when checking the timestamp of Version.cs. The fix I linked of ensuring Version.cs is created before wpf targets run, and then not generating that file within the wpf temp proj resolved it for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Toolbox: Accelerate your builds of SDK-style ...
Enabling Build Acceleration can reduce incremental build times by up to 80% for SDK-style .NET projects. To enable build acceleration in your ...
Read more >
Improve incremental build scoping (avoid rebuilding ...
My team works on a large/complex UWP app comprised of a mixture of C# and C++/CX projects. Our productivity has been hindered by...
Read more >
How-to migrate Wpf projects to the new VS2017 format
After some searching and trial and error I got it working! This is the final wpf csproj: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> < ...
Read more >
Making a WPF app using a SDK-style project with ...
NET Core SDK, we've enjoyed a better C# project format, often called “SDK-style” because you specify a SDK to use in the project...
Read more >
Version vs VersionSuffix vs PackageVersion: What do they ...
In this post I look at the various version numbers you can set when building a .NET Core project, such as Version, VersionSuffix, ......
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