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

Notification

Icon
Error

Build fails with project reference outside solution root
RichardHauer
#1 Posted : Monday, April 3, 2023 9:07:10 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2022(UTC)
Posts: 6
Location: Australia

I have a large number of repos that are normally built as nuGet packages, but from time-to-time it's practical to just attach projects together in a solution. This solution will contain ProjectReference includes that are outside the solution root (since they are from different repos).

In VS this builds just fine, and in LiveUnitTesting I can specify a "root" folder for testing that's higher up the tree than the Solution, so that works ok too. nCrunch is failing to build, however, complaining about:

The type or namespace name 'Foo' does not exist in the namespace 'Bar' (are you missing an assembly reference?)

The namespace actually in the project that is referenced in via the aforementioned ProjectReference.

I kinda assume the issue is to do with the solution root, but does anyone know of a workaround for this or is this a proper bug?
RichardHauer
#2 Posted : Monday, April 3, 2023 9:20:59 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2022(UTC)
Posts: 6
Location: Australia

Anecdotally - I created some "direction junction symlinks" to relocate the distant projects into a subfolder of the main solution, restarted VS and the nCrunch stack fully builds and runs now.

So I guess if you found this, I created a folder inside the solution root called "_imports" but that's not material.
Then I used "mklink /J" to create links to my distant projects and re-locate them inside the solution.

I set the junctions low enough that VS can see all the git folders and it is showing multiple repos as well. So far, so good. Bit of a hack though.
Remco
#3 Posted : Monday, April 3, 2023 11:27:40 PM(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.

NCrunch itself actually doesn't care about the solution root. It's possible to have projects specified well outside the solution directory and the tool should be able to find them - but it's important that these project reference each other using correct relative paths specified using ProjectReference elements (absolute paths won't work).

I suspect there is something else going on here that is throwing out the NCrunch build. If you'd like me to examine the problem in more detail, the next step would be to submit a bug report after you've enabled NCrunch and the build has failed. I can then examine the log to see if there is any obvious misbehaviour. Understanding that you've found a workaround for the issue, whether you want to proceed with this is up to you.
RichardHauer
#4 Posted : Tuesday, April 4, 2023 12:08:41 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2022(UTC)
Posts: 6
Location: Australia

Remco;16573 wrote:
Hi, thanks for sharing this issue.

NCrunch itself actually doesn't care about the solution root. It's possible to have projects specified well outside the solution directory and the tool should be able to find them - but it's important that these project reference each other using correct relative paths specified using ProjectReference elements (absolute paths won't work).

I suspect there is something else going on here that is throwing out the NCrunch build. If you'd like me to examine the problem in more detail, the next step would be to submit a bug report after you've enabled NCrunch and the build has failed. I can then examine the log to see if there is any obvious misbehaviour. Understanding that you've found a workaround for the issue, whether you want to proceed with this is up to you.


Well the workaround is a PITA and I would prefer not to have to do this every time. Happy to share the build logs but there's not too much to see from my initial take - the project in question was not even mentioned in the log at all!

Note that while I'm happy to share the logs I can't do that publicly. Shall I raise a ticket somewhere?
Remco
#5 Posted : Tuesday, April 4, 2023 11:30:26 PM(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)
RichardHauer;16574 wrote:

Well the workaround is a PITA and I would prefer not to have to do this every time. Happy to share the build logs but there's not too much to see from my initial take - the project in question was not even mentioned in the log at all!

Note that while I'm happy to share the logs I can't do that publicly. Shall I raise a ticket somewhere?


There's an option under NCrunch that allows you to submit a bug report (it's in the NCrunch menu). If you use this option after the build has failed, it'll let you submit an encrypted copy of the internal log of the engine that covers the point of failure along with any major configuration that may be involved. The log isn't always certain to give me the information I need to solve the problem, but it's usually a great place to start because of its convenience.
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.045 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download