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.

Default ProduceReferenceAssembly to true

See original GitHub issue

Get better incremental build performance by opting in to reference assembly based builds by defaulting ProduceReferenceAssembly to true.

Since this is a behaviour change, it may be good to do it in 3.0 and for SDK projects only.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:24 (22 by maintainers)

github_iconTop GitHub Comments

5reactions
dsplaistedcommented, May 11, 2020

In our sync-up, we decided to go ahead with enabling this by default for .NET 5.0 and higher.

5reactions
rainersigwaldcommented, Oct 2, 2018

Ok, I did a small proof-of-concept that things are still broken.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Write reference assemblies to IntermediateOutputPath - .NET
In .NET 5, the ProduceReferenceAssembly property was introduced and defaulted to true for net5.0 and later applications. With this change, many ...
Read more >
How to produce ReferenceAssemblies with dotnet
I'm struggling with the following problem: I added <ProduceReferenceAssembly>true</ProduceReferenceAssembly> to my CSPROJ (and I also tried ...
Read more >
Every time I make a change in code, does not take the ...
Forms default template project has the <ProduceReferenceAssembly>true</ProduceReferenceAssembly> MSBuild property set in the .
Read more >
Fix unable to find *.deps.json for unit tests in .NET 5
Solution 1. Set ProduceReferenceAssembly to false · Solution 2. Ignore the /ref/ folder in your test tasks in Azure DevOps · Tobias Zimmergren....
Read more >
Tips & Tricks to improve your .NET Build Setup with MSBuild
MSBuild is the powerful - now open source - build system used in all .NET Builds. It has a language of its own...
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