-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NB.GV defeats incremental build for .NET SDK style WPF projects #175
Comments
I think the first thing that needs to be fixed for this scenario to work is NuGet/Home#5894. Without PackageReference working properly for WPF projects, it's going to fail regardless of what we do in the NB.GV package. |
I opened dotnet/msbuild#3254 for that issue. They both need to be fixed IMO, order doesn't matter. In my experience it was much harder to discover and solve this NB.GV issue than the WPF import issue. That one was relatively simple. WPF tmp_proj gets the same |
No argument there. Just that it's a low priority for me to fix an issue in a scenario Microsoft doesn't support, whose workaround is not straightforward. I'm still investigating, but at this stage I'm just trying to get a repro (with the workaround applied) so I can see the problem. And the nuget bug makes it difficult. |
OK, so I've finished applying a workaround for the WPF nuget import issue. After that, NB.GV works. This matches the experience I have in the VS-Platform repo where we have several such WPF projects that use NB.GV. You mentioned an incremental build regression with NB.GV. Is that really the only issue? |
It is the incremental build issue. |
I create version.cs.new first and compare it with version.cs before overwriting version.cs specifically to keep incremental build working. How does touching version.cs.new break incremental build, seeing as it's not a compile input? And I don't touch version.cs at all unless it changed. |
I updated my comment above. I debugged into |
@AArnott FWIW, the SDK Extras 1.5.4 includes a fix for the WPF imports stuff based on a new variable they set. |
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.2.0 to 17.3.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](microsoft/vstest@v17.2.0...v17.3.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Related discussion in #642 (comment) |
The problem is the WPF inner build and outer build define different root namespace, so the generated assemblyinfo file is different from inner to outer builds: 31c31
< internal const string RootNamespace = "fix642_clrmgcrv_wpftmp";
---
> internal const string RootNamespace = "fix642"; So a workaround would be to set |
Ah, interesting! Thanks for digging in! |
Confirmed setting RootNamespace fixes the incremental build. Thanks again! |
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:
GenerateAssemblyVersionInfo
run beforeMarkupCompilePass1
GenerateAssemblyVersionInfo
inside the WPF temporary project.Version.cs
generated from the original project in the WPF temporary project.See https://devdiv.visualstudio.com/DevDiv/VS%20IDE%20CPS/_git/CPS/pullrequest/120052?_a=overview for the workarounds I performed to get this to work.
The text was updated successfully, but these errors were encountered: