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

Notification

Icon
Error

Rider: NCrunch fails to build
Jholbrouck
#1 Posted : Tuesday, September 10, 2024 10:34:50 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
For the third time in a month or 2 I have a project which builds perfectly fine in Rider, but NCrunch fails to build it.

Even after I clean/rebuild the project, and restart the NCrunch engine it still fails to build the project.

The solution seems to be to restart Rider, after which it builds fine.

The latest error I got was a simple reference to a file 1 folder higher. The error I got was:

'Business\Commands\Customer\Impl\AddCustomerCommand.cs (19, 84): The type or namespace name 'IAddCustomerCommand' could not be found (are you missing a using directive or an assembly reference?)

In rider it builds/works as expected. If I change the name of the interface, it does immediatly update in the error message, but whatever I do, the error message remains. I have even tried deleting the file and undoing the delete.

Only closing rider and restarting it makes the error go away.

Any clue what could be going on here, or what I could try if it happens again?
Remco
#2 Posted : Tuesday, September 10, 2024 11:28:47 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
Thanks for sharing this issue.

This feels like a desync of some kind. Could you submit an NCrunch bug report after you've had this happen to you? The log may show some useful details.

Also, when it happens, could you confirm whether a reset of the NCrunch engine or opening/closing the source files involved in the IDE makes any difference?
Jholbrouck
#3 Posted : Tuesday, September 10, 2024 11:34:37 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
I have tried opening/closing the source files in the IDE, this did not help. If with resetting the NCrunch engine you mean the 'Restart the NCrunch engine, resynchronise with VS and rebuild all projects (Reset)' button, I tried that as well and it did not make a difference.

Since it doesn't happen frequently I don't know when the bug report will come, but I will do so when it happens.

Thanks :)
Remco
#4 Posted : Tuesday, September 10, 2024 11:41:42 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
Thanks! I think this is a desync issue inside the IDE rather than the engine. I'm hopeful the report will be useful. Please do sent it through next time you see the problem.
michaelkroes
#5 Posted : Tuesday, September 10, 2024 11:46:40 AM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Hi, just a quick check; we had these issues before, and I was wondering if you're on the latest version of both NCrunch and Rider? If so, the bug report would be helpful :)
Jholbrouck
#6 Posted : Tuesday, September 10, 2024 1:58:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
Hi there,

Thanks both for the quick responses.

Seems like it happened again rather quickly: I had the same issue appearing in a different file and made a bug report this time.

The name was something like 'NCrunch fails to build : post 3497'.

I am not on the latest Rider (I'm on 2024.1.4 instead of 2024.1.6), but I am on the latest NCrunch (5.9.0.1)
Jholbrouck
#7 Posted : Friday, September 13, 2024 9:58:04 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
I have meanwhile updated to the latest version of Rider and have the issue again. I've made another bug report so you can check it in both versions.

Name of bug report: 'Desync between Rider and NCrunch build - Post3497'
1 user thanked Jholbrouck for this useful post.
Remco on 9/13/2024(UTC)
michaelkroes
#8 Posted : Monday, September 16, 2024 3:07:39 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Thanks for upgrading to the latest Rider version. I had a look at the bug report, and I see that the file containing the not found code should be present in the workspace. At least it's referenced in the workspace project file.

When you get this error, would you mind checking the workspace of the project and inspecting the file in there? You can do this by right-clicking on the project in the NCrunch Tests window and clicking on advanced -> browse to workspace. This should open an explorer navigated to the workspace directory. This is what NCrunch uses to build the assemblies that are run during testing. Could you inspect the contents of the file that should contain the not found code?

Also, another question that we had was, are you running any other extensions that could interfere with the contents of the editor windows?
Jholbrouck
#9 Posted : Tuesday, September 17, 2024 7:12:58 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
My only Rider plugin is NCrunch, I don't think there is anything out of the ordinary that could interfere with it. When this happens again, I will follow the above instructions and keep you updated.
Jholbrouck
#10 Posted : Tuesday, September 17, 2024 7:49:42 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
And I seem to get the error quite frequently lately.

Currently it happened again, I inspected the workspace and the files are identical to the files in my IDE.

I'll wait a bit with restarting my Rider instance in case you have more questions/things to investigate.
Remco
#11 Posted : Tuesday, September 17, 2024 10:52:24 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
When this happens, could you try running MSBuild.exe against the generated project file in the NCrunch workspace, to see if it kicks up the same error as NCrunch? This will help to establish if something is wrong inside the build system itself.
Jholbrouck
#12 Posted : Tuesday, September 17, 2024 2:46:40 PM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
I did not yet run MSBuild.EXE, I did come a little bit closer to the issue/ a solution.


I can replicate the issue by using the rename functionality in Rider.

I managed to replicate this in a new solution, where just creating a class,

namespace ClassLibrary1
{
public class DeSyncTest : IDesyncTest
{
}
}
And an interface in a seperate file

namespace ClassLibrary1
{
public interface IDesyncTest
{
}
}

If I rename the interface in the command using the 'Rename', I get the error. In the test project it doesn't always happen (sometimes I can see it happen and then it fixes itself again, sometimes it happens and it does not fix itself, until I make an edit in the file that can't be found or restart Rider).

In the main project I am using, it breaks more consistently. If I look in the workspace I can indeed see that the rename did not properly happen in the workspace, so the MSBuild would probably also fail.

I made another bug report: 'Post 3497'
I recreated the issue, I got the error, checked the workspace which did not contain the rename. I tried reloading the project which doesn't fix the issue, but in the newly made project resetting the NCRunch project seems to help.
Also when I open submit a bug report it fixes the issue most of the time, although for this bug report it didn't.
1 user thanked Jholbrouck for this useful post.
michaelkroes on 9/17/2024(UTC)
michaelkroes
#13 Posted : Tuesday, September 17, 2024 2:58:54 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Interesting; that did the trick! It's reproducible now. I'm looking into fixing this and I hope it will be fixed in the next release which we hope to deliver soon.
2 users thanked michaelkroes for this useful post.
Jholbrouck on 9/17/2024(UTC), Paramethod on 9/20/2024(UTC)
Jholbrouck
#14 Posted : Tuesday, September 17, 2024 4:07:11 PM(UTC)
Rank: Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 10
Location: Belgium

Thanks: 3 times
Was thanked: 5 time(s) in 4 post(s)
Great, looking forward to the fix! Thanks
Remco
#15 Posted : Thursday, September 26, 2024 1:11:38 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
Sorry for the wait. It took some time to fully corner this one (it is freakishly intermittent).

A fix has been included in v5.10, which has just been released. Please give it a try and let me know if the problem is solved on your side.
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.066 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download