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

Notification

Icon
Error

NCrunch 4 - optimized instrumentation - BadImageFormatException for x64 for F# project
slyvs
#1 Posted : Friday, November 8, 2019 12:12:29 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/5/2018(UTC)
Posts: 2
Location: Switzerland

Hello,
Thanks for great update, first of all. But there may be an issue with building x64 F# unit test projects.
- It works with legacy mode.
- It fails for more than one project in my solution. But, so that happened, one of failing projects could have been converted to AnyCPU, and the problem was resolved for that project.

Code:
ENGINE - [13:06:27.635-LocalAnalysisTask-36] ERROR (Analysis): A failure occurred while analysing the assembly [SnapshotComponent: WAVE.ViewModels.FSharp.Tests, 79, 31750222]: System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\vadim\AppData\Local\NCrunch\13560\86\WAVE.ViewModels.FSharp.Tests\bin\Debug\net472\WAVE.ViewModels.FSharp.Tests.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///C:\Users\vadim\AppData\Local\NCrunch\13560\86\WAVE.ViewModels.FSharp.Tests\bin\Debug\net472\WAVE.ViewModels.FSharp.Tests.dll'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at nCrunch.Common.ExecutionPlatform.LoadAssembly(FilePath assemblyFilePath)
   at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(DescribedTestFrameworkDiscoverer[] applicableFrameworks, ComponentUniqueName testComponentUniqueName, PerfTracker perfTracker)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



The project file is following:
Code:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
    <DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
    <DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <IsPackable>false</IsPackable>
    <Platforms>x64</Platforms>
    <PlatformTarget>x64</PlatformTarget>
    <Deterministic Condition="'$(NCrunch)' == '1'">false</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>portable</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    <DebugType>portable</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="..\GlobalAssemblyInfo.fs" Link="GlobalAssemblyInfo.fs" />
    <Compile Include="SelfUpdateViewModelTests.fs" />
  </ItemGroup>
  
  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
    <PackageReference Include="Unquote" Version="5.0.0" />
    <PackageReference Include="xunit" Version="2.4.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\WAVE.ViewModels\WAVE.ViewModels.csproj" />
  </ItemGroup>
</Project>
Remco
#2 Posted : Friday, November 8, 2019 10:46:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,830

Thanks: 754 times
Was thanked: 973 time(s) in 927 post(s)
Hi, thanks for sharing this issue.

As expected, we've had a bit of a wave of these sort of issues with the new optimised mode. I'll take a look at this one as soon as I can and will get back to you :)
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.023 seconds.