Announcements

We are currently experiencing an issue impacting some Autodesk Products and Services - please refer to the Autodesk Health Dashboard for updates.

Happens occasionally for the same .dll file: Unable to load .dll file caused by the disappearance of the file.

Happens occasionally for the same .dll file: Unable to load .dll file caused by the disappearance of the file.

bsaidiDG51
Enthusiast Enthusiast
594 Views
7 Replies
Message 1 of 8

Happens occasionally for the same .dll file: Unable to load .dll file caused by the disappearance of the file.

bsaidiDG51
Enthusiast
Enthusiast

I have an AutoCAD macro that when clicked, it netloads a dll file and then executes a command found within that dll.

Everything works fine most of the time, but occasionnally, I noticed that the dll file disappears on its own and therefore I get this message when I click on the macro: 

bsaidiD4GJM_1-1718810610330.png

 

Another information that might help find the problem: I get the same message when I could see that the .dll file exists, but when I try to netload it manually using the dialog box below, I get the message File not found, even when I could see literally see it and select it. This definitely happens because another user has loaded the dll before the "disappearance" but hasn't closed his AutoCAD since, which makes it visible but not useable.

bsaidiD4GJM_2-1718810928674.png

 

 

0 Likes
595 Views
7 Replies
Replies (7)
Message 2 of 8

ActivistInvestor
Mentor
Mentor

I've never seen anything like what you're describing (e.g.,'the assembly disappears on its own').  I have seen attempts to a load a duplicated (and possibly different) assembly from another location that has failed.

 

Use (findfile "assemblyname.dll") and see if AutoCAD returns a path. If it does, make sure it's the same path you're trying to load the assembly from.

0 Likes
Message 3 of 8

bsaidiDG51
Enthusiast
Enthusiast
I used (findfile "{pathAndNameOfMyDll}") and it returns nil, but now that I rebuilt my solution so that I generate the dll file, the same command returns the value of {pathAndNameOfMyDll}.
After regenerating the dll file, now the macro works since the dll file can be found.
This macro always works, but once in a while it stops working because it cannot find the dll file.

Additional information: The dll is on a folder found on the server and multiple users have access to and use this macro.
0 Likes
Message 4 of 8

ActivistInvestor
Mentor
Mentor

Is the 'once in a while' failure occurring only after you rebuild the project and regenerate the assembly?

0 Likes
Message 5 of 8

bsaidiDG51
Enthusiast
Enthusiast
No, 0 link between the two.
Last time the solution was built was 8 days ago.
The failures occur randomly, couldn't find a trigger.
0 Likes
Message 6 of 8

bsaidiDG51
Enthusiast
Enthusiast

Update: It happened again today, and this time it might be related to the fact that I tried to compile the project and it failed because someone had the dll loaded in his AutoCAD.

 

Now when I tried to manually load the dll (ListesDeValidation.dll), this the pop up I get: 

bsaidiD4GJM_0-1721228387574.png

 

And when I asked all users to close their AutoCAD (in order to "free" the dll), the dll disappeared.

0 Likes
Message 7 of 8

ActivistInvestor
Mentor
Mentor

Doesn't that confirm that another copy of the .DLL is being loaded from a different location?

0 Likes
Message 8 of 8

norman.yuan
Mentor
Mentor

It sounds to me that your VS project's build output location is where the application DLL deployment location (a network share) where users load the app from. If so, it is a bad practice, IMO.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes