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

Notification

Icon
Error

npgsql upsets ncrunch
SteveEllwood
#1 Posted : Thursday, May 7, 2015 8:26:19 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/30/2014(UTC)
Posts: 10
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I have an application which uses npgsql to access a postgres database. I installed this using Nuget however Ncrunch doesn't like it and I get the message

Quote:
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.

The following assembly references have triggered this warning:
C:\Repos\SOA\NLCWS2hg\NLC_SOAv2hg\bin\Npgsql.dll


Is this something I should be concerned about and if so how do I resolve the issue?

thanks
Remco
#2 Posted : Thursday, May 7, 2015 9:39:23 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,

This warning is NCrunch telling you about something that is wrong with the dependency structure in your solution. It isn't necessarily an NCrunch problem - it can mess up many things in your build. There's a good chance that NCrunch will continue to work without obvious problems, though you'll be sitting on a timebomb that will almost certainly give you trouble at some stage.

Let's just say we have MyAssembly.dll which is a 3rd party dependency you've introduced from somewhere, and we have MyProject.csproj which has an assembly reference to MyAssembly.dll.

Now, we build MyProject.csproj. Normal build behaviour will copy MyAssembly.dll into MyProject's output directory, so it sits next to MyProject.dll.

Then, we go and delete MyAssembly.dll from the place where MyProject.csproj was originally referencing it. In normal circumstances, you would expect the build in this situation to be broken.

But it isn't. This is because MSBuild contains implicit behaviour that will search around for MyAssembly.dll in order to try and find it. Eventually, it will just settle on the copy of MyAssembly.dll in MyProject's build output directory, and use that instead.

This is dangerous because the contents of a build output directory should be transient and shouldn't be used as a source for assembly references, but MSBuild will do this if its primary search paths fail, and it won't warn you about it either .. but NCrunch will.

You should investigate how this file is being resolved and where it should be referenced from. Clearing out all your build output directories may help with troubleshooting this problem.

1 user thanked Remco for this useful post.
SteveEllwood on 5/7/2015(UTC)
SteveEllwood
#3 Posted : Thursday, May 7, 2015 1:18:46 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/30/2014(UTC)
Posts: 10
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Thanks for this Remco

I wasn't trying to suggest it was a problem with Ncrunch, I just wasn't sure how to resolve it but I do understand the issue a lot better now
1 user thanked SteveEllwood for this useful post.
Remco on 5/7/2015(UTC)
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.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download