Reputation: 31
I've inherited the responsibility of managing a website that uses the compiled code to work. I need to make some changes to the code but it appears that all the .cs files have been removed and I have no idea whether there is a back up or not so I've resorted to using the filedisassembler plugin with .NET Reflector. The file disassembler spits out the all the cs files with the correct name but upon inspecting them, all of the files have the same error and are truncated.
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at ...Resolve(IAssemblyReference assemblyReference, String localPath)
at Reflector.FileDisassembler.FileDisassemblerHelper.AssemblyResolver.Resolve(IAssemblyReference assemblyName, String localPath)
at ..Load(IAssemblyReference assemblyReference, String localPath)
at Reflector.CodeModel.Memory.AssemblyReference.Resolve()
at .....ctor(ICollection namespaces, INamespace namespaceDeclaration)
at ...WriteNamespace(INamespace value)
at Reflector.FileDisassembler.FileDisassemblerHelper.WriteTypeDeclaration(ITypeDeclaration typeDeclaration, ILanguageWriterConfiguration configuration)
This error seems to stop the .NET reflector from decompiling rest of the cs files. How can I overcome this problem?
Upvotes: 1
Views: 2587
Reputation: 4833
I used https://github.com/0xd4d/dnSpy when I was in the same situation. It allows to patch DLL on the fly.
Upvotes: 1