Home

ICSharpCode.NRefactory/Resources errors after most recent update.

I am attempting to query an EntityFramework ObjectContext. It worked yesterday until I restarted Linqpad after the most recent update downloaded. The error is TargetInvocationException: Exception has been thrown by the target of an invocation, the exceptions are 3 each of the following:

Could not load file or assembly 'ICSharpCode.NRefactory, Version=3.0.0.3630, Culture=neutral, PublicKeyToken=efe927acf176eea2' or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly 'Resources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=21353812cd2a2db5' or one of its dependencies. The system cannot find the file specified.

I have removed Linqpad and the Appcache and reinstalled, and
I have tried getting the nuget packages for NRefactory and adding the namespaces to my query, which reduces the instance of the first missing assembly to 1, but the 3 missing Resources errors persist.

Any thoughts?



Comments

  • I can't reproduce this with a standard ObjectContext connection. Are there any further clues you can give me? Is it just one typed ObjectContext that gives you the error, and is there anything special about it?

    Also, does it make any difference if you disable process isolation in Edit | Preferences | Advanced?
  • edited March 2015
    I tried disabling process isolation...no effect. It is happening with any of the various ObjectContexts in my organization (each team has their own) and on multiple machines. We do extend ObjectContext but only to add additional contructors and override dispose. And that was working with Linqpad until recently. Is there a repository of older versions that I might try one to see that it still works?

  • edited March 2015
    I think I've figured the cause. Code in your ObjectContext somewhere is calling some code that does this:
    foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
    	foreach (var type in assembly.DefinedTypes)
    	{
    		// ...
    	}
    
    Could this be the case?
  • You are on to something. We are using MEF to locate components, and it is failing when it attempts to walk your executable...this was successful until the most recent update. If I attach a debugger to the linqpad process and skip the mef component location chunk of code, I get results back from the database. Any thoughts on what might have changed to bring about this behavior?
  • Try the new beta. It has code which should mitigate that.
  • Indeed it did solve the issue! Thank you Joe!
Sign In or Register to comment.