Problem:
I was trying to get Resharper’s dupfinder to run from a command line script. Using Resharper’s command line tools. I keep getting the errors below.
The solution came from https://devnet.jetbrains.com/thread/460601;jsessionid=FB59ACB66FFC17A22451A99A63A1BD76 which basically says
Remove Zone.Identifier NTFS Alternate Data Stream (http://msdn.microsoft.com/en-us/library/dn392609.aspx) from the ZIP file before using it.
turns out it was spot on. I used 7Zip instead of windows built in Zip extractor. Everything worked after that.
Error I received:
— EXCEPTION #1/6 [NotSupportedException]
Message = “An attempt was made to load an assembly from a network location which would have caused the assembly to be sa
ndboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by def
ault, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRem
oteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.”
ExceptionPath = Root.InnerException.InnerException.InnerException.InnerException.InnerException
ClassName = System.NotSupportedException
HResult = COR_E_NOTSUPPORTED=80131515— Outer —
— EXCEPTION #2/6 [FileLoadException]
Message = “Could not load file or assembly ‘file:///C:\CLT\JetBrains.ReSharper.Features.NuGet.dll’ or one of its depende
ncies. Operation is not supported. (Exception from HRESULT: 0x80131515)”
ExceptionPath = Root.InnerException.InnerException.InnerException.InnerException
ClassName = System.IO.FileLoadException
InnerException = “Exception #1 at Root.InnerException.InnerException.InnerException.InnerException.InnerException”
HResult = COR_E_NOTSUPPORTED=80131515
Source = mscorlib
FileLoad_FileName = file:///C:\CLT\JetBrains.ReSharper.Features.NuGet.dll
StackTraceString = ”
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Runtime
Assembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntros
pection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity,
RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for
Introspection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity,
RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean s
uppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashVa
lue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stac
kMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at JetBrains.Application.Parts.FileBasedPartCatalogueAssemblyBinder.JetBrains.Application.Parts.IPartCatalogueAssem
blyBinder.BindToRuntimeAssembly()
”— Outer —
— EXCEPTION #3/6 [InvalidOperationException]
Message = “Could not bind a part catalog assembly by loading from file C:\CLT\JetBrains.ReSharper.Features.NuGet.dll.”
ExceptionPath = Root.InnerException.InnerException.InnerException
ClassName = System.InvalidOperationException
InnerException = “Exception #2 at Root.InnerException.InnerException.InnerException.InnerException”
HResult = COR_E_INVALIDOPERATION=80131509
Source = JetBrains.Platform.ComponentModel
StackTraceString = ”
at JetBrains.Application.Parts.FileBasedPartCatalogueAssemblyBinder.JetBrains.Application.Parts.IPartCatalogueAssembly
Binder.BindToRuntimeAssembly()
at JetBrains.Application.Parts.PartCatalogueAssembly.Bind()
”— Outer —
— EXCEPTION #4/6 [InvalidOperationException]
Message = “Could not load the runtime assembly for the part catalog assembly “Assembly: JetBrains.ReSharper.Features.NuG
et, Version=103.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325″.”
ExceptionPath = Root.InnerException.InnerException
ClassName = System.InvalidOperationException
InnerException = “Exception #3 at Root.InnerException.InnerException.InnerException”
HResult = COR_E_INVALIDOPERATION=80131509
Source = JetBrains.Platform.ComponentModel
StackTraceString = ”
at JetBrains.Application.Parts.PartCatalogueAssembly.Bind()
at JetBrains.Application.Parts.PartCatalogueType.Bind()
at JetBrains.Application.Extensibility.PartComponentDescriptor.CreateInstance(IValueResolveContext context)
at JetBrains.Application.Components.SingletonDescriptor.CreateInstanceChecked(OnError onError, IComponentContainer
container)
at JetBrains.Application.Components.SingletonDescriptor.GetValue()
at JetBrains.Application.Components.InitializationStrategyDefault.Schedule(Lifetime lifetime, IComponentDescriptor
dsc)
”— Outer —
— EXCEPTION #5/6 [TargetInvocationException]
Message = “Component JetBrains.ReSharper.Features.NuGet.NuGetSolutionManager [Singleton, Corrupted] construction has fai
led.”
ExceptionPath = Root.InnerException
ClassName = System.Reflection.TargetInvocationException
InnerException = “Exception #4 at Root.InnerException.InnerException”
HResult = COR_E_TARGETINVOCATION=80131604— Outer —
— EXCEPTION #6/6 [LoggerException]
Message = “Component JetBrains.ReSharper.Features.NuGet.NuGetSolutionManager [Singleton, Corrupted] construction has fai
led.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
InnerException = “Exception #5 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = ”
at JetBrains.Application.Components.ComponentStorage.InstantiateDescriptors(IEnumerable`1 descriptors)
at JetBrains.Application.Components.ComponentStorage.ComposeDescriptors(ICollection`1 descriptors)
at JetBrains.ProjectModel.SolutionInstance.OpenSolution(ISolutionOwner solutionOwner)
at JetBrains.ProjectModel.SolutionManagerBase.<>c__DisplayClass6.<CreateSolutionInstance>b__4()
at JetBrains.Util.Logging.Logger.Catch(Action action)
at JetBrains.ProjectModel.Tasks.SolutionLoadTasksSchedulerBase.ExecuteOneTask(SolutionLoadTask task)
at JetBrains.ProjectModel.Tasks.SolutionLoadTasksSchedulerBase.DispatchTasks(Boolean background)
at JetBrains.ProjectModel.SolutionManagerBase.CreateSolutionInstance(SolutionElement solutionElement, SolutionInsta
nce solutionInstance)
at JetBrains.ProjectModel.Impl.SolutionManagerImpl.CreateSolution(FileSystemPath solutionFilePath)
at JetBrains.CommandLine.DupFinder.Application.DupFinderProductMain.RunGuarded()
at JetBrains.CommandLine.DupFinder.Application.DupFinderProductMain.<>c__DisplayClass1.<Run>b__0()
at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)
at JetBrains.CommandLine.DupFinder.Application.DupFinderProductMain.Run()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] paramete
rs, CultureInfo culture)
at JetBrains.Application.Environment.RunsPublicStaticIntMain.<>c__DisplayClass7.<.ctor>b__0()
at JetBrains.Util.Logging.Logger.Catch(Action action)
at JetBrains.Threading.JetDispatcher.Closure.Execute()
at JetBrains.Threading.Win32JetDispatcher.ProcessQueue()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numA
rgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Objec
t state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state,
Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& h
andled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numA
rgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate met
hod, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at JetBrains.DataFlow.Lifetimes.Using(Action`1 ?)
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containe
rEnv)
at JetBrains.Application.Environment.JetEnvironment.InternalRun(JetHostParametersCaller host, ComponentContainer co
ntainerEnv)
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(Full hostparams)
at JetBrains.CommandLine.DupFinder.Application.DupFinderProgram.Main(Assembly assembly, HostInfo hostInfo, String[]
args)
at JetBrains.CommandLine.DupFinder.Application.DupFinderProgram.Main(String[] args)
“
It worked for me also – when I used 7 zip instead of the default extract tool. Thanks!
Similar issue, but I found just going to properties on the zip file and clicking “unblock”, solved it for me (which is actually what they direct you to do in the first place….that’ll teach me not to RTFM!)
@Andrew This option was not available for me, but I am glad it worked for you. Thanks for sharing another possible solution!
run by powershell:
Get-Item E:\JetBrains.ReSharper.CommandLineTools.2016.2.20160913.100041\* -Force | foreach { Unblock-File -Path $_.FullName }