Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Referencing assemblies within the build output
Onto Innovation
#1 Posted : Monday, February 22, 2021 11:58:42 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/22/2021(UTC)
Posts: 3
Location: United States of America

Hi,

I'm working with a large solution that contains an intentionally setup project that serves as the "master" project for all NuGet dependencies. It contains no code, and is the first project in the solution's build order. As an artifact of its build, copies of its referenced assemblies are copied into a unique output folder (which is not shared as the output folder by any other project in the solution). All other projects in the solution then reference their dependencies in this special output folder (rather than individually using NuGet). The intent, as I understand it, is to have a single point of control for versioning NuGet dependencies.

I've recently started using NCrunch on this solution, and am receiving a large number of warnings:

It has been detected that this component is referencing assemblies within the build output directories of projects within this solution. It is strongly recommended that assemblies are referenced from a directory location that is not subject to disruption from the build process.

Directly referencing assemblies that are updated, copied or manipulated by the build of projects in this solution will create implicit build dependencies that cannot be tracked by NCrunch or MSBuild. This can result in inconsistent build behaviour patterns and code versioning issues. It can also cause problems when trying to execute a clean build of the solution after it is checked out of a source control system.


I noticed that I can rt-click each warning, and select "Hide selected warning". I'd prefer to not hide that warning for all projects, because upon inspection, it did actually highlight a couple of legitimate problems where assemblies were being referenced in the common build output folder.

Is there any way to preserve this warning check, but whitelist a specific folder so that it does not trigger the warning?

Thanks!
Remco
#2 Posted : Tuesday, February 23, 2021 7:21:24 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

As you've noticed, this warning is a false positive. Your setup project is likely structured so that the reference files are being copied to the same output directory as would normally be occupied by the assembly built for this project. If you're using the standard .NET project template for this project, then there will likely be an empty .DLL file in the same directory, which is why NCrunch gives this warning. We often have situations where people use NCrunch on solutions where the referenced assemblies point towards the DLLs output from the build system, and this causes some really crazy things to happen in both NCrunch and VS, so where it works, this is actually an important warning.

Unfortunately there is no way to whitelist a directory so this warning doesn't get flagged up ... but is it perhaps possible for you to ignore the master project under NCrunch? If I understand its purpose, it only exists to supply reference assemblies in the foreground solution anyway. It likely isn't required for NCrunch to build your solution as long as VS has built the foreground solution at some stage.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.034 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download