ComException : Record not found on lookup after round-tripping CLI/C++ assembly.

View: New views
5 Messages — Rating Filter:   Alert me  

ComException : Record not found on lookup after round-tripping CLI/C++ assembly.

by JohnC-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Here are the steps to reproduce the error:

In Visual Studio 2005, create a new Visual C++ --> CLR --> CLR Console
Application.
Change project setting to /clr:pure
Build project.
Using SVN head version of Cecil, round-trip the assembly:
            AssemblyDefinition ad = AssemblyFactory.GetAssembly(@"C:
\Console\Debug\Console.exe");
            AssemblyFactory.SaveAssembly(ad, @"C:\Output
\Console.exe");

When running the output assembly, I get a 'ComException : Record not
found on lookup' error at startup.

I researched this on web and there is not much info about this error,
but it may be related to invalid characters in type names.





--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: ComException : Record not found on lookup after round-tripping CLI/C++ assembly.

by JohnC-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear Jb,

I found more about this issue:

When compiling with /clr:safe, the error does not happen.

It only happens when compiling with /clr:pure
In this case, the compiler emits a lot of helper structs and maybe
writing back one of them is causing the problem.

Since /clr:pure is 100% managed (not mixed mode) and is equivalent to
C# in unsafe mode, i guess Cecil should be able to read and write it
correctly?

Please take a look at this issue.



On Aug 18, 1:24 pm, JohnC <john.cro...@...> wrote:

> Here are the steps to reproduce the error:
>
> In Visual Studio 2005, create a new Visual C++ --> CLR --> CLR Console
> Application.
> Change project setting to /clr:pure
> Build project.
> Using SVN head version of Cecil, round-trip the assembly:
>             AssemblyDefinition ad = AssemblyFactory.GetAssembly(@"C:
> \Console\Debug\Console.exe");
>             AssemblyFactory.SaveAssembly(ad, @"C:\Output
> \Console.exe");
>
> When running the output assembly, I get a 'ComException : Record not
> found on lookup' error at startup.
>
> I researched this on web and there is not much info about this error,
> but it may be related to invalid characters in type names.
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: ComException : Record not found on lookup after round-tripping CLI/C++ assembly.

by Jb Evain-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hey,

On 8/19/09, JohnC <john.crowe6@...> wrote:
>  Please take a look at this issue.

Please provide a simple and small test assembly.

--
Jb Evain  <jb@...>

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: ComException : Record not found on lookup after round-tripping CLI/C++ assembly.

by JohnC-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear Jb,

I have uploaded a new file named 'cli_cpp_assembly_bug.zip' in the
files area. It contains the compiled assembly (Console.exe) as well as
the Visual Studio generated source for the assembly.

Thanks.

On Aug 19, 1:24 pm, Jb Evain <j...@...> wrote:

> Hey,
>
> On 8/19/09, JohnC <john.cro...@...> wrote:
>
> >  Please take a look at this issue.
>
> Please provide a simple and small test assembly.
>
> --
> Jb Evain  <j...@...>
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: ComException : Record not found on lookup after round-tripping CLI/C++ assembly.

by JohnC-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear Jb,

Were you able to reproduce the issue? If I can do anything to help,
let me know.



On Aug 19, 2:50 pm, JohnC <john.cro...@...> wrote:

> Dear Jb,
>
> I have uploaded a new file named 'cli_cpp_assembly_bug.zip' in the
> files area. It contains the compiled assembly (Console.exe) as well as
> the Visual Studio generated source for the assembly.
>
> Thanks.
>
> On Aug 19, 1:24 pm, Jb Evain <j...@...> wrote:
>
> > Hey,
>
> > On 8/19/09, JohnC <john.cro...@...> wrote:
>
> > >  Please take a look at this issue.
>
> > Please provide a simple and small test assembly.
>
> > --
> > Jb Evain  <j...@...>
>
>
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---