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

Notification

Icon
Error

Project failing to build - stuck in 'First time build' status
cskardon
#1 Posted : Monday, July 5, 2021 12:18:43 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2012(UTC)
Posts: 8
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Hello!

I have a solution with 4 projects, on an older laptop they were all building and running tests correctly, having just setup a new one, I'm finding NCrunch will no longer run the tests. The 'library' project doesn't build (get's stuck with the message: 'First time build') and the other projects are just listed as 'Not built'.

The solution compiles in Visual Studio and via pwsh, just not in NCrunch, and R# can run all the tests

I'm on VS 2019 16.10.3
NCrunch 4.8.0.3

I'd normally see the reason for failing to build in the Trace Output, but I'm seeing nothing - and I'm not sure where to look

Any pointers would be greatly appreciated

All the best

Charlotte
Remco
#2 Posted : Monday, July 5, 2021 1:15:50 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,510

Thanks: 852 times
Was thanked: 1155 time(s) in 1079 post(s)
Hi Charlotte,

Thanks for sharing this problem.

Most likely there is a problem occurring under the hood that isn't being reported properly. Would you mind submitting a bug report through the NCrunch menu after you've had this happen to you? The log in the report should help me to analyse the issue on this side.
cskardon
#3 Posted : Monday, July 5, 2021 1:30:09 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2012(UTC)
Posts: 8
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Hey Remco,

I've done it - let me know if there is something you want me to do to replicate it
Remco
#4 Posted : Tuesday, July 6, 2021 12:27:26 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,510

Thanks: 852 times
Was thanked: 1155 time(s) in 1079 post(s)
Thanks Charlotte, I've received the bug report and confirmed the exception below:

System.Exception: System.BadImageFormatException: Could not load file or assembly 'nCrunch.TestRuntime, Version=4.8.0.3, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'nCrunch.TestRuntime, Version=4.8.0.3, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea'
at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCorePlatformType.GetCoverageEventListenerTypeForInstrumentation(CilContext context)
at nCrunch.Compiler.NewStaticManipulation.ImportedNCrunchRuntimeAssembly..ctor(CilContext context, CilManipulationOperation manipulationOperation, IBuildPlatformType platformType)
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.Instrument(IInstrumentationFilter[] instrumentationFilters, PerfTracker perfTracker)
at nCrunch.Compiler.CilProcessingTasks.CilInstrumentationTask.ProcessTask(IBuiltAssembly builtAssembly, ComponentInstrumentationParameters instrumentationParameters, BuildOutput output)
at nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()

I've never seen this issue before. nCrunch.TestRuntime is a .NET 3.5 assembly that is shipped with NCrunch, and I can't think of any reason it would fail to load other than the file being corrupt. Could you try reinstalling the version of NCrunch you're using? I'm hoping this will fix the file and allow instrumentation to continue as normal.
cskardon
#5 Posted : Wednesday, July 7, 2021 1:19:09 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2012(UTC)
Posts: 8
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Hey Remco,

I uninstalled and redownloaded to be sure -
It's all now working as expected! Thank you!
1 user thanked cskardon for this useful post.
Remco on 7/7/2021(UTC)
MihaMarkic
#6 Posted : Wednesday, July 14, 2021 10:12:54 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/8/2015(UTC)
Posts: 7
Location: Slovenia

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I'm seeing a similar issue, but the exception seems different (peeked into report.zip). Also, only a single (not test) project fails to build. Reinstalling doesn't help. Bug report submitted.
Remco
#7 Posted : Wednesday, July 14, 2021 1:28:45 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,510

Thanks: 852 times
Was thanked: 1155 time(s) in 1079 post(s)
MihaMarkic;15523 wrote:
I'm seeing a similar issue, but the exception seems different (peeked into report.zip). Also, only a single (not test) project fails to build. Reinstalling doesn't help. Bug report submitted.


Thanks for sending through the bug report. It looks like the NCrunch instrumentation is failing because the assembly it's processing doesn't have a Type Definition table. I haven't seen this before, but I suppose it might be possible to build such an assembly if you're compiling code that doesn't declare any types. Do you have any classes declared in the failing project? If not, does adding a class suppress the issue?
MihaMarkic
#8 Posted : Thursday, July 15, 2021 8:50:56 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/8/2015(UTC)
Posts: 7
Location: Slovenia

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

It actually has plenty of types and was also building before. The csproj looks like this (below), nothing special except for InternalsVisibleToAttribute (which declares that attribute, but same approach is used in my other projects and it is not new for this project as well).
Any idea what can I try?

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Test</_Parameter1>
<!-- We use the value of AssemblyName to declare the value of the attribute -->
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
</ItemGroup>
</Project>
Remco
#9 Posted : Thursday, July 15, 2021 1:25:58 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,510

Thanks: 852 times
Was thanked: 1155 time(s) in 1079 post(s)
Is there any chance you can build a code sample that can reproduce the issue which you can share with me? Something is unusual about the structure of the DLL being built here. I wonder if that AssemblyAttribute might have something to do with it.
MihaMarkic
#10 Posted : Friday, July 16, 2021 12:35:38 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/8/2015(UTC)
Posts: 7
Location: Slovenia

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Hm, not sure what or when it happened, but the project is building again and tests are running. Before that I've tried to isolate the problematic project, but it worked in a new solution.
Basically it's fine now and I can't reproduce it anymore. Hopefully it won't reappear.
Remco
#11 Posted : Saturday, July 17, 2021 1:44:07 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,510

Thanks: 852 times
Was thanked: 1155 time(s) in 1079 post(s)
MihaMarkic;15537 wrote:
Hm, not sure what or when it happened, but the project is building again and tests are running. Before that I've tried to isolate the problematic project, but it worked in a new solution.
Basically it's fine now and I can't reproduce it anymore. Hopefully it won't reappear.


Thanks for letting me know. If you manage to reproduce it somewhere down the line, I'd like to dig a bit deeper. Probably this is not the last we'll see of this problem.
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.173 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download