NB.GV defeats incremental build for .NET SDK style WPF projects
See original GitHub issueNerdbank 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:
- Make
GenerateAssemblyVersionInfo
run beforeMarkupCompilePass1
- Do not run
GenerateAssemblyVersionInfo
inside the WPF temporary project. - 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:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top 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 >
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 Free
Top 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
@AArnott FWIW, the SDK Extras 1.5.4 includes a fix for the WPF imports stuff based on a new variable they set.
I updated my comment above. I debugged into
MarkupCompilePass1
, and its incremental build check always failed when checking the timestamp ofVersion.cs
. The fix I linked of ensuringVersion.cs
is created before wpf targets run, and then not generating that file within the wpf temp proj resolved it for me.