Tanakorn,

This may-not help; as you have already stated the problem '*The problem is
I don't have the assembly that Mono.Cecil wants to resolve* so even if I
give WriterParameters with DefaultAssemblyResolver, it doesn't' help.'

If Mono can not resolve an assembly - it will throw an error -- so this
video is not the answer; however, it might create a thinking point for your
about your problem and how you might resolve it:
https://www.google.com/search?q=create+an+assembly+in+vs+2017&rlz=1C1GCEU_enUS844US844&oq=creat+an+asssebly+in+vs&aqs=chrome.1.69i57j33l4.10823j0j8&sourceid=chrome&ie=UTF-8

good luck;

Sam

On Thu, Sep 26, 2019 at 3:24 PM Tanakorn Leesatapornwongsa <
[email protected]> wrote:

> Here is the stack trace of the execution,
>
> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: '...'
>    at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name,
> ReaderParameters parameters)
>    at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference
> name)
>    at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
>    at Mono.Cecil.TypeReference.Resolve()
>    at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
>    at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference
> constant_type, Object constant)
>    at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner,
> TypeReference type)
>    at Mono.Cecil.MetadataBuilder.AddParameter(UInt16 sequence,
> ParameterDefinition parameter, ParamTable table)
>    at Mono.Cecil.MetadataBuilder.AddParameters(MethodDefinition method)
>    at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
>    at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
>    at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
>    at Mono.Cecil.MetadataBuilder.AddTypes()
>    at Mono.Cecil.MetadataBuilder.BuildTypes()
>    at Mono.Cecil.MetadataBuilder.BuildModule()
>    at Mono.Cecil.MetadataBuilder.BuildMetadata()
>    at Mono.Cecil.ModuleWriter.<>c.<BuildMetadata>b__2_0(MetadataBuilder
> builder, MetadataReader _)
>    at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
>    at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1
> stream, WriterParameters parameters)
>    at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module,
> Disposable`1 stream, WriterParameters parameters)
>    at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters
> parameters)
>
>
> On Monday, September 23, 2019 at 8:14:42 PM UTC-7, Tanakorn
> Leesatapornwongsa wrote:
>>
>> Hi,
>>
>> I got this exception, AssemblyResolutionException when I try to write
>> assembly back. Even with this simple code, it also fails
>>
>> string path1 = "assembly1.dll";
>> string path2 = "copy1.dll";
>> AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(path1);
>> assembly.Write(path2); // AssemblyResoultionException is thrown here
>>
>> I have read the previous post about DefaultAssemblyResolver,
>> https://groups.google.com/forum/#!searchin/mono-cecil/failed$20to$20resolve|sort:date/mono-cecil/2YrccvV3dpY/xh05pT6DAwAJ
>> The problem is I don't have the assembly that Mono.Cecil wants to resolve
>> so even if I give WriterParameters with DefaultAssemblyResolver, it
>> doesn't help.
>>
>> Is there any way to work around this? Or I am prohibited to write an
>> assembly that using other assemblies that I don't have them with me?
>>
>> Thank you,
>> Tanakorn L.
>>
> --
> --
> --
> mono-cecil
> ---
> You received this message because you are subscribed to the Google Groups
> "mono-cecil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mono-cecil/6d974b6b-ba52-4ed9-b483-0b1f9cb6857a%40googlegroups.com
> <https://groups.google.com/d/msgid/mono-cecil/6d974b6b-ba52-4ed9-b483-0b1f9cb6857a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mono-cecil/CAFc38JXiuzDHEemLrsEr25OpCfV1PfA4z2%3DOwp7cDyCbmKfxBw%40mail.gmail.com.

Reply via email to