Corrupted .NET DLL files

Corrupted .NET DLL files

GTVic
Advisor Advisor
735 Views
2 Replies
Message 1 of 3

Corrupted .NET DLL files

GTVic
Advisor
Advisor

Wondering if anyone had a similar experience and could explain how this problem fixed itself.

 

  1. Distributed an updated macro written in VB.NET as a DLL to be loaded with NETLOAD. The user copied the updated DLL file to the correct location under C:\ProgramData\Autodesk\ApplicationPlugins which obviously overwrote the existing file.
  2. Macro was running fine for a month
  3. Macro crashed on Wednesday. Crash meaning that Civil 3D disappeared without warning and the standard Autodesk error report dialog appeared. I believe Autodesk refers to this as a "quick exit". :). The typical .NET assembly error dialog did not appear.
  4. Rebooting the computer, restarting Civil 3D, even going back to an old copy of the DWG could not get the macro working properly again. The macro would load and work for a while but the act of switching stations to work on a particular section view would eventually cause a crash.
  5. The user had kept the files I sent him and re-copied the DLL file to the correct location under ApplicationPlugins.
  6. The macro is now running properly again.

The only thing I can think of is that it is possible for the assembly to be corrupted in the GAC and the above step #5 fixed the problem somehow. But I am not familiar enough with how that all works to say for sure and it doesn't explain the exact timing of the crash, stepping one by one to a particular section view or jumping directly to the specific station would cause the crash. And the problem would occur in different drawings as well.

0 Likes
736 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor

The DLL is loaded into AutoCAD automatically when AutoCAD starts. So, do you see any error message at command line?

 

Since you say "Macro crashed", it indicates the DLL is loaded correctly and only running the commands defined in the DLL causes the crash. Therefore, to me, it is not the DLL file being "corrupted" (or, it probably would not be loaded and/or the custom commands in it would not be available).

 

If it is due to "corruption" in the GAC, then re-copy the the DLL to the computer should not help because the issue is in GAC. So, it looks like not because of "corrupted" GAC.

 

Is this DLL is the only one in the plugin, or one of the multiple DLLs? If it is the former, I'd say it is very possible that the code in does not work correctly with certain drawing data; if it is the latter, things would be more complicated, depending on how the DLL is compiled.

 

But "corruption" would possibly not be the reason of the crashing. 

 

Does the commands need to access data/resources from somewhere when executing, such as data stored in certain location, as file, database, or event as services from remote location. If so, unavailable resources at the execution time for whatever reasons could be the cause of crash, of course.

 

Also, how do you "distribute" the DLL? sending it to your users via the Internet (email attachment, cloud share, such as Google Drive/DropBox/OneDrive share...)? If so, the receiver needs to unlock it, or the DLL would not load into AutoCAD correctly (then you would not be able to run the commands in it, which seems not the case with you. But I still mention it here anyway).

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

GTVic
Advisor
Advisor
  1. RE: unlocking. The user is familiar with that process as I am giving him updated DLLs on a regular basis. Unlocking would not explain the macro working for a while then not working, then working again after overwriting.
  2. It is just a single DLL. After overwriting I was told the exact same steps were followed and the problem did not reoccur. The DLL only requires what is in the current drawing.
  3. The macro would load properly and work properly for a short period, all without errors, and then Civil 3D would exit too quickly to see any messages.

https://stackoverflow.com/questions/3295622/where-is-the-net-jit-compiled-code-cached 

0 Likes