Exception thrown when reversing .Net Core DLLs

Hi,

I am working on a development project which uses .Net core framework. I would like to generate Class diagrams by using the Instant Reverse functionality with the DLLs resulting from the build of the application’s code. Unfortunately, I am getting an exception during the processing. I am using VP 15.0 (Build 20180231 ).

I get the following error message:
Reason :
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at a…ctor(Assembly[] A_0)
at e…ctor(String A_0, String A_1)
mscorlib
Could not load file or assembly ‘System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly ‘System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly ‘System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

Could you please release a path for this ?

Thanks in advance,

Hi Sebas,

Can you provide a sample DLL that can reproduce the problem?

Hello,

How can I send it to you? This Web app does not allow the upload of DLLs or ZIPs. Otherwise, you can simply create a netcore2 project with Visual Studio, add a few classes and then build it. That’s the DLL I have on hand to reproduce this bug.

Hi Sebas,

I’m sorry that we cannot support reverse .NET core at the moment.
The reverse engine was built on .NET framework, but it seems that .NET framework cannot load .NET core assembly.

Hi,

Well this unfortunate. Could you recommend a workaround ? If Iuse DOxygen to generate a XML doc from the code, can I reverse engineer this XML into a class diagram ?

Hi,

You can try this workaround for doxygen output with Tools>Code>Instant Reverse…>C++ Source:


e.g. copy doxygen output to c:\test\ouf, should have c:\test\ouf\index.xml

And we’ll consider enhancing this to support more languages, so you can reverse your source without this workaround.

Another solution is reverse by Visual Studio Integration.

Hi,

My apologies for the delay. I have tried your workaround and it works fine. I had already tried the Visual Studio integration and I had also encountered issues because only the cs files which are in the root were reverse engineered. The ones stored in sub-folders are not synchronized.

Being able to reverse engineer directly the cs files would be a great feature for my organization.

Thank you for your quick answers.

Sebastien Gamby

Hi Sebas,

We’ll enhance Instant Reverse to support C Sharp source. I’ll keep you informed when it is ready.

1 Like

Hi Sebas,

I would like to let you know our engineers had enhanced the Instant Reverse engine to solve your problem. Please update the software to latest patch build (20180330bt or later) to get the problem fixed. Details about update to latest patch can be found at

  • Please make sure you have pressed the “Update to latest patch” button on the left hand side of the dialog right after launching the update program

Feel free to contact me if you require any further information and wish you have a good day!

Best regards,
Rain Wong

Hi,

I have installed the latest patch on VP 15.0 and tried a reverse engineering by providing directly the folder holding our source code. Unfortunately there are a couple of issues so far:

  • The ‘enum’ classes are ignored
  • The children classes (extending parent classes) are ignored

Those classes are reverse engineered when using the DOxygen workaround.

Regards,

Sebastien

Hi Sebas,

I briefly tested but cannot reproduce the problem. Can you attach some example code?

Hi,

I have tried to prepare a small solution to demonstrate the bug and by doing that I have realized that I was wrong about the issue. It took me a moment but this time I think that I nailed: if the very first line of the CS file is “namespace …” then the file is ignored. Here is an example VP_Bug_Demo.

If you add “Using …” statements or at least one empty line then the file is reverse engineered.

Hi Sebas,

I tested with the following code (1st line is namespace), but still cannot reproduce the problem with Instant Reverse.

namespace VisualParadigmTest.Domain
{
	enum Color {
		Red, Green, Blue
	}
}

This is the reverse result:
ir1
ir2

Strange. I have provide below a print screen of my dual screen (VP on left, VS on the right). I have re-opened the “Instant Reverse” dialog in case it helps. The “class repository” is presented in order to show the classes reverse engineered when clicking on the OK Button of the “Instant Reverse” dialog.

Are you sure that “namespace” is the very first word in your test file? I have made a few more tests and found out that even a white space before “namespace” is enough to bypass the bug.

Hi Sebas,

I can reproduce the problem by creating the file in Visual Studio.
I found it caused by the Instant Reverse UI showing wrong default encoding, please reverse by specifying “Other: UTF-8” in Encoding.

Hi,

I confirm it solves the issue on my side as well. That’s quite original :confused:

Hi Sebas,

Instant Reverse was enhanced to support reverse the file created by Visual Studio with default encoding. It’ll be available in next patch.

Hi Sebas,

I would like to let you know our engineers had enhanced the Instant Reverse engine which now support reverse files created by Visual Studio with default encoding. Please update the software to latest patch build (20180330cf or later) to get the problem fixed. Details about update to latest patch can be found at

  • Please make sure you have pressed the “Update to latest patch” button on the left hand side of the dialog right after launching the update program

Feel free to contact me if you require any further information and wish you have a good day!

Best regards,
Rain Wong

Hi,

I have tested the latest patch and it works fine.

Thanks a lot,

Sebastien