Skip to content
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

Legacy project system fast up-to-date check does not work with ProduceReferenceAssembly=true #4079

Closed
nguerrera opened this issue Oct 2, 2018 · 5 comments
Assignees
Labels
Legacy Issues against the legacy project system. Triage-Approved Reviewed and prioritized
Milestone

Comments

@nguerrera
Copy link
Contributor

nguerrera commented Oct 2, 2018

@rainersigwald wrote:

MixedSolutionWithRefAssemblies.zip

This solution has:

  • An SDK netstandard library that produces reference assemblies
  • A net472 .exe
  • A net472 unit test project

The unit test project tests library functionality by calling the app that calls the library.

  1. Open up the solution in VS and run the test through the UI.
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  1. It fails, because there's an error in the library. It subtracts instead of adds.
  2. Fix the error:
diff --git a/Lib/Class1.cs b/Lib/Class1.cs
index a33c4c0..76a1c90 100644
--- a/Lib/Class1.cs
+++ b/Lib/Class1.cs
@@ -6,7 +6,7 @@ namespace Lib
     {
         public static int Add(int a, int b)
         {
-            return a - b; // note deliberate error
+            return a + b;
         }
     }
 }
  1. Run the test again.
  2. The test still fails, because
========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========

That's because the fast-up-to-date check in csproj doesn't understand that it needs to tell MSBuild to build the app even though its direct input (the lib.dll reference assembly) hasn't changed. CoreCompile will be skipped, but the build will copy the implementation assembly along, so that the updated implementation is available at runtime.

@nguerrera nguerrera added Legacy Issues against the legacy project system. Parity-CPS labels Oct 2, 2018
@rainersigwald
Copy link
Member

Related changes in CPS:

@Pilchie Pilchie added the Bug label Oct 8, 2018
@Pilchie Pilchie added this to the 16.0 milestone Oct 8, 2018
@jjmew jjmew modified the milestones: 16.0, 16.X Feb 13, 2019
@jjmew jjmew added this to the 16.X milestone Mar 13, 2019
@jjmew jjmew added the Triage-Approved Reviewed and prioritized label Mar 13, 2019
@tmeschter
Copy link
Contributor

Tom's triage notes: probably not hard to fix (I think the problem is we're only considering the reference assembly as an output item and not also the implementation assembly) but not something I think we have to fix, either.

@tmeschter
Copy link
Contributor

Ah, no, it's a little more complicated than that: we need to consider both the reference assembly and implementation assemblies to be outputs, and for each input reference if there is an associated implementation assembly we need to consider that input as well.

@tmeschter
Copy link
Contributor

After further review of the spec (#2254) and implementation (#2414) for the CPS-based project system, I've decided this will be more complicated than initially thought to implement for CSProj. As such, we're not going to fix this.

@drewnoakes
Copy link
Member

This was added in a recent 17.x build.

@drewnoakes drewnoakes removed the Bug label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Legacy Issues against the legacy project system. Triage-Approved Reviewed and prioritized
Projects
None yet
Development

No branches or pull requests

6 participants