We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
I am trying to remove some embedded resources.
// the list TmpRemove contains the list of resources to remove ...
IEnumerable<MethodDefinition> TmpMethods = Asm.MainModule.Types.Where(o => o.IsClass == true && o.Name == "AssemblyLoader") .SelectMany(type => type.Methods) .Where(o => o.FullName.Contains("cctor")); MethodDefinition TmpMethod = null; if (TmpMethods != null && TmpMethods.Count() > 0) TmpMethod = TmpMethods.First(); List<Instruction> TmpInstruction = new List<Instruction>(); foreach (Resource res in TmpRemove) { Asm.MainModule.Resources.Remove(res); if (!res.Name.StartsWith("costura.tds.") && TmpMethod != null) { for (int i = 0; i < TmpMethod.Body.Instructions.Count; i++) { if (TmpMethod.Body.Instructions[i].Operand != null && TmpMethod.Body.Instructions[i].Operand.Equals(res.Name)) { TmpMethod.Body.SimplifyMacros(); TmpInstruction.Add(TmpMethod.Body.Instructions[i - 2]); TmpInstruction.Add(TmpMethod.Body.Instructions[i - 1]); TmpInstruction.Add(TmpMethod.Body.Instructions[i]); TmpInstruction.Add(TmpMethod.Body.Instructions[i + 1]); TmpMethod.Body.OptimizeMacros(); } } } } foreach (Instruction ins in TmpInstruction) TmpMethod.Body.Instructions.Remove(ins);
This works fine, the resources are removed from my dll.
But I have a problem with the PDB file not getting updated correctly :
using (AssemblyDefinition TmpAssembly = AssemblyDefinition.ReadAssembly(TargetPath, new ReaderParameters { SymbolReaderProvider = new PdbReaderProvider(), ReadSymbols = true, ReadWrite = true })) { MemoryStream ms = null; Find(true, TmpExport, TmpAssembly, ref ms); TmpAssembly.Write(new WriterParameters() { WriteSymbols = true, SymbolWriterProvider = new Mono.Cecil.Pdb.PdbWriterProvider(), }); }
I get this error -
1> Non-negative number required. 1> Parameter name: count
Any help is apprishiated .Anyone ?
Regards
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
I am trying to remove some embedded resources.
// the list TmpRemove contains the list of resources to remove ...
This works fine, the resources are removed from my dll.
But I have a problem with the PDB file not getting updated correctly :
I get this error -
1> Non-negative number required.
1> Parameter name: count
Any help is apprishiated .Anyone ?
Regards
The text was updated successfully, but these errors were encountered: