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

Notification

Icon
Error

NCrunch fails to build (and then test)
Dirk Maegh
#1 Posted : Monday, April 10, 2023 6:54:15 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 48
Location: Belgium

Thanks: 6 times
Was thanked: 7 time(s) in 7 post(s)
Hi,

I just opened this repo https://github.com/andre...capades.EnumGenerators/
And then the solution NetEscapades.EnumGenerators.sln.

Building runs fine in VS2022 (latest version, Windows 11)
I do not have all .Net frameworks installed, and am only interested in .Net 6 and 7, and NetStandard. I would like to create source generators for myself.

Opening test explorer sees a lot of tests, I ran the following for .Net 6 and .Net 7. without problems
NetEscapades.EnumGenerators.IntegrationTests
NetEscapades.EnumGenerators.NetStandard.IntegrationTests
NetEscapades.EnumGenerators.Tests

But NCrunch 4.16.01 seems to have some trouble building. (and I had to reload a lot of the projects to make them build)

The project NetEscapades.EnumGenerators.NetStandard shows following NCrunch logs
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (62, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (62, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (20, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (20, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (50, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (28, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (50, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (28, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (39, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (39, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (9, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (9, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (70, 6): The type or namespace name 'EnumExtensionsAttribute' could not be found (are you missing a using directive or an assembly reference?)
..\NetEscapades.EnumGenerators.IntegrationTests\Enums.cs (70, 6): The type or namespace name 'EnumExtensions' could not be found (are you missing a using directive or an assembly reference?)

There are more problems, but this one probably is the most pressing ?

Thx for looking into this one :)

Dirk
Remco
#2 Posted : Tuesday, April 11, 2023 12:08:26 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 937 times
Was thanked: 1262 time(s) in 1174 post(s)
Dirk Maegh
#3 Posted : Thursday, April 13, 2023 5:32:52 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 48
Location: Belgium

Thanks: 6 times
Was thanked: 7 time(s) in 7 post(s)
Thanks for letting me try your new build.
It indeed solves most of the issues.

After I configured NCrunch to completely ignore all dotnet frameworks I hadn't installed, it resolved all builds and tests, except for the one project _build.
It does not compile in NCrunch.

<Quote>
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
CSC (0, 0): Generator 'StronglyTypedSolutionGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not find file 'C:\Users\DirkMaegh\AppData\Local\NCrunch\4400\18\NetEscapades.EnumGenerators.sln'.'
Build.cs (122, 26): 'Solution' does not contain a definition for 'tests' and no accessible extension method 'tests' accepting a first argument of type 'Solution' could be found (are you missing a using directive or an assembly reference?)
Build.cs (123, 26): 'Solution' does not contain a definition for 'tests' and no accessible extension method 'tests' accepting a first argument of type 'Solution' could be found (are you missing a using directive or an assembly reference?)
</Quote>

In VS2022, it gives me following output
<Quote>
Rebuild started...
Restored C:\Projects\NetEscapades.EnumGenerators\src\NetEscapades.EnumGenerators\NetEscapades.EnumGenerators.csproj (in 22 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\src\NetEscapades.EnumGenerators.Attributes\NetEscapades.EnumGenerators.Attributes.csproj (in 15 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\samples\ToStringFastExample\ToStringFastExample.csproj (in 172 ms).
1>------ Rebuild All started: Project: _build, Configuration: Debug Any CPU ------
Restored C:\Projects\NetEscapades.EnumGenerators\build\_build.csproj (in 267 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.NetStandard\NetEscapades.EnumGenerators.NetStandard.csproj (in 4 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.Benchmarks\NetEscapades.EnumGenerators.Benchmarks.csproj (in 380 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.Nuget.IntegrationTests\NetEscapades.EnumGenerators.Nuget.IntegrationTests.csproj (in 427 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.Nuget.Attributes.IntegrationTests\NetEscapades.EnumGenerators.Nuget.Attributes.IntegrationTests.csproj (in 426 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.Tests\NetEscapades.EnumGenerators.Tests.csproj (in 425 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.NetStandard.IntegrationTests\NetEscapades.EnumGenerators.NetStandard.IntegrationTests.csproj (in 424 ms).
Restored C:\Projects\NetEscapades.EnumGenerators\tests\NetEscapades.EnumGenerators.IntegrationTests\NetEscapades.EnumGenerators.IntegrationTests.csproj (in 290 ms).
1>_build -> C:\Projects\NetEscapades.EnumGenerators\build\bin\Debug\_build.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
========== Rebuild started at 7:31 AM and took 00,991 seconds ==========
</Quote>
Remco
#4 Posted : Friday, April 14, 2023 12:12:48 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 937 times
Was thanked: 1262 time(s) in 1174 post(s)
Great to hear we are getting closer on this one :)

I suspect this issue may be caused by a dependency on a solution file that isn't in the NCrunch workspace. Does adding the .sln file to your NCrunch 'Additional files to include' setting resolve the issue?
Dirk Maegh
#5 Posted : Sunday, April 16, 2023 9:32:14 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 48
Location: Belgium

Thanks: 6 times
Was thanked: 7 time(s) in 7 post(s)
Yes it does :)
But that is certainly not intuitive.

Thx for your assistance.
1 user thanked Dirk Maegh for this useful post.
Remco on 4/16/2023(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.055 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download