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

Notification

Icon
Error

Could not load file or assembly 'System.Runtime, Version=4.1.1.0...'
MatthewSteeples
#1 Posted : Tuesday, August 22, 2017 3:31:10 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Getting the following error message in the Errors tab of 2 of our servers in the NCrunch Distributed Processing window

The file in question does exist, so not sure why it's coming up with this. Both are running VS2017 15.3.1 (latest). Project is a full .NET framework 4.6.2 system (not .NET core)

NCrunch version 3.11.0.3 (preview release from another thread)

Code:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Runtime.dll' or one of its dependencies. The system cannot find the file specified.
File name: 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Runtime.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.CustomAssemblyResolver.ResolveAssembly(ParsedAssemblyName parsedAssemblyName)
   at nCrunch.Common.CustomAssemblyResolver.(Object , ResolveEventArgs )
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

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].

   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
   at nCrunch.TestExecution.Reflection.Clr.ClrMember.GetAttributesWithoutInheritance()
   at nCrunch.Module.MSTest.Integration.MSTestWorkspace.findDeploymentItems(TestName[] testsToRunInWorkspace, ReflectedAssembly testAssembly)
   at nCrunch.Module.MSTest.Integration.MSTestWorkspace..ctor(MSTestNames names, DirectoryPath solutionDirectory, DirectoryPath runtimeWorkspacePath, ReflectedAssembly testAssembly, TestName[] testsToRunInWorkspace)
   at nCrunch.Module.MSTest.Integration.MSTestFrameworkRuntimeEnvironment.<>c__DisplayClass11_0.<RunTests>b__1()
   at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
   at nCrunch.Common.PerformanceTracking.PerfTracker.TryTrackActivity(String name, Action activity)
   at nCrunch.Module.MSTest.Integration.MSTestFrameworkRuntimeEnvironment.RunTests(TestTaskOutput output, TestExecutionMapSet testMapSet, TestExecutionParameters parameters, IIpcMessageProcessor messageProcessor)
   at nCrunch.TestExecution.TestRunnerThread.()

Remco
#2 Posted : Tuesday, August 22, 2017 10:35:14 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
MatthewSteeples
#3 Posted : Wednesday, August 23, 2017 9:39:55 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Very early indication looks like it has fixed it on one grid node but not on another. Are there any logs we can send over to help?
MatthewSteeples
#4 Posted : Wednesday, August 23, 2017 10:19:34 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Early indications were wrong I'm afraid, and it's failing intermittently on all build servers. We're being tough on you this month aren't we!
Remco
#5 Posted : Wednesday, August 23, 2017 11:29:14 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Can you confirm whether the grid nodes are able to run tests when using NCrunch as a VS package? My feeling is that this is either a missing dependency on the grid node that isn't being properly handled, or its dependency data that isn't translating to the grid node properly.
MatthewSteeples
#6 Posted : Tuesday, September 5, 2017 1:32:08 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Hi Remco,

Sorry for the delay in getting back to you with this. I don't think this error stops the GridNodes from running the tests itself, as our tests still seem to run fine whether on the GridNode or using NCrunch in Visual Studio.
Remco
#7 Posted : Wednesday, September 6, 2017 1:35:27 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
If this message does give you trouble, it may be worth upgrading to the full release version of 3.11 (released just yesterday). This included a few resolution fixes over the preview version you've been running.
MatthewSteeples
#8 Posted : Wednesday, September 20, 2017 6:48:09 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Have updated to the latest version, and also enabled FusionLog for this and get slightly better stack trace:

Code:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Runtime.dll' or one of its dependencies. The system cannot find the file specified.
File name: 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Runtime.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.CustomAssemblyResolver.ResolveAssembly(ParsedAssemblyName parsedAssemblyName)
   at nCrunch.Common.CustomAssemblyResolver.(Object , ResolveEventArgs )
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Runtime.dll
LOG: Appbase = file:///C:/NCrunch Grid Node/3240/5/Ledgerscope.Project/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\NCrunch Grid Node\3240\5\Ledgerscope.Project\bin\Debug\Ledgerscope.Project.dll.config.ncrunchconfig
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
   at nCrunch.TestExecution.Reflection.Clr.ClrMember.GetAttributesWithoutInheritance()
   at nCrunch.Module.MSTest.Integration.MSTestWorkspace.findDeploymentItems(TestName[] testsToRunInWorkspace, ReflectedAssembly testAssembly)
   at nCrunch.Module.MSTest.Integration.MSTestWorkspace..ctor(MSTestNames names, DirectoryPath solutionDirectory, DirectoryPath runtimeWorkspacePath, ReflectedAssembly testAssembly, TestName[] testsToRunInWorkspace)
   at nCrunch.Module.MSTest.Integration.MSTestFrameworkRuntimeEnvironment.<>c__DisplayClass11_0.<RunTests>b__1()
   at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
   at nCrunch.Common.PerformanceTracking.PerfTracker.TryTrackActivity(String name, Action activity)
   at nCrunch.Module.MSTest.Integration.MSTestFrameworkRuntimeEnvironment.RunTests(TestTaskOutput output, TestExecutionMapSet testMapSet, TestExecutionParameters parameters, IIpcMessageProcessor messageProcessor)
   at nCrunch.TestExecution.TestRunnerThread.()


The really strange thing is that that file does exist on both the client and the server. I'm adding the NuGet package to that project and seeing if that helps
Remco
#9 Posted : Wednesday, September 20, 2017 11:11:32 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Sorry, it looks like I may need to ask for a code sample that can reproduce this :(

This is going to be a tough one to figure out. The CLR is having an internal issue while trying to load this assembly. My experience with these sorts of problems suggests that trying to get specific information about why the reference is failing to load may be extremely difficult, perhaps even impossible without extensive experimentation.

Can you confirm for me the context of this exception? Does it only appear on the grid nodes? Does your local machine work OK?
MatthewSteeples
#10 Posted : Thursday, September 21, 2017 11:14:32 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
[img=https://ledgerscope-my.sharepoint.com/personal/matthew_ledgerscope_com/_layouts/15/guestaccess.aspx?docid=0b9b3f64ced0c4b8aa8de0f4e84c84999&authkey=AbtIU707wlgB909LCm5tCbo]Error[/img]

That's where we're seeing the error. The grid node does process tests afterwards (the exception usually happens in bunches of 3, and then doesn't happen for a while). Locally we don't get any errors listed (although I'm not sure where the local equivalent of that view would be).

I'll see if I can decompose enough of it to put together a code sample, but it may end up being the whole project
Remco
#11 Posted : Thursday, September 21, 2017 11:47:48 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
NCrunch is continuing to function in this case because the error is happening only during the analysis task, when tests are discovered.

The analysis task is always run on each grid node after a build. Because only one task is actually needed to get the true list of tests, the redundancy allows the engine to continue. As long as your local machine or at least one grid node can report a result without the error appearing, the tests are discovered and they can be farmed out to the grid.

So it's still bad, because it means that you have nodes that are unable to discover the tests. The rest of the grid compensates.

I would suggest looking at install state differences between the nodes to examine whether the nodes that don't work are lacking something (perhaps an SDK?).
MatthewSteeples
#12 Posted : Thursday, September 21, 2017 5:35:49 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 134
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Solved it!

That was our only VS Test Project that didn't have a reference to the NuGet package System.Runtime. I think our migration to VSTest v2 might have caused this issue, and NuGet/Microsoft have started doing weird stuff where you need to have references to stuff that is already built into the framework

Thanks for your help
Remco
#13 Posted : Thursday, September 21, 2017 11:44:43 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Horrah! I'm glad you found the solution! Thanks for letting me know :)
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.079 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download