Author Topic: How to reload a .dll into AutoCAD without closing or restarting  (Read 4424 times)

0 Members and 2 Guests are viewing this topic.

cadwiki.net

  • Mosquito
  • Posts: 6
How to reload a .dll into AutoCAD without closing or restarting
« on: January 29, 2022, 09:53:46 PM »
I recently built a solution that allows reloading the same copy of a .dll into AutoCAD without closing or restarting.
This way developers can test their changes without closing and restarting AutoCAD.

Check out my blog with the full solution:

http://www.cadwiki.net/blogpost/How-to-reload-a-.dll-into-AutoCAD

cadwiki.net

  • Mosquito
  • Posts: 6
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #1 on: August 12, 2022, 03:08:45 PM »
I recently released cadwiki's first nuget package with a package that allows AutoCAD developers to reload dll's

blog post
http://www.cadwiki.net/blogpost/cadwiki.DllReloader-nuget-package

example repo
https://github.com/cadwiki/cadwiki-nuget-examples

nuget package
https://www.nuget.org/packages/cadwiki.DllReloader

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #2 on: August 16, 2022, 08:12:24 AM »
Cool stuff.
Will this shutdown loaded reactors, or is IExtensionApplication.Terminate() called for the app being unloaded?
I’m not using .net at the moment, just wondering

Jeff H

  • Needs a day job
  • Posts: 6144
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #3 on: August 16, 2022, 09:01:15 AM »
This is a problem people have wanted a solution to, thanks for putting in the effort and sharing.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2120
  • class keyThumper<T>:ILazy<T>
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #4 on: August 17, 2022, 04:20:01 AM »
This is a problem people have wanted a solution to, thanks for putting in the effort and sharing.


Yes, but I'm happy restarting and auto-loading the rebuilt assembly.  . . . becoming more patient with age, and use the time to re-evaluate expectations.

Pity it's not in a language I'm more comfortable with.  :)
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #5 on: August 17, 2022, 05:14:15 AM »
This is a problem people have wanted a solution to, thanks for putting in the effort and sharing.


Yes, but I'm happy restarting and auto-loading the rebuilt assembly.  . . . becoming more patient with age, and use the time to re-evaluate expectations.

Pity it's not in a language I'm more comfortable with.  :)

Things are different in the SSD age, if you're coding on a 5400rpm spinner... wonder if my u.s. robotics 56k modem still works

57gmc

  • Bull Frog
  • Posts: 358
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #6 on: August 17, 2022, 10:26:35 AM »
This is a problem people have wanted a solution to, thanks for putting in the effort and sharing.


Yes, but I'm happy restarting and auto-loading the rebuilt assembly.  . . . becoming more patient with age, and use the time to re-evaluate expectations.

Pity it's not in a language I'm more comfortable with.  :)

Things are different in the SSD age, if you're coding on a 5400rpm spinner... wonder if my u.s. robotics 56k modem still works
That's mezozoic! ;-)

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2120
  • class keyThumper<T>:ILazy<T>
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #7 on: August 17, 2022, 04:46:39 PM »
This is a problem people have wanted a solution to, thanks for putting in the effort and sharing.


Yes, but I'm happy restarting and auto-loading the rebuilt assembly.  . . . becoming more patient with age, and use the time to re-evaluate expectations.

Pity it's not in a language I'm more comfortable with.  :)

Things are different in the SSD age, if you're coding on a 5400rpm spinner... wonder if my u.s. robotics 56k modem still works
That's mezozoic! ;-)

Hi Ed,
I'm mesozoic , but my SSD isn't :)
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

daboho

  • Newt
  • Posts: 40
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #8 on: August 29, 2022, 07:51:44 AM »
This for all autocad version ?

cadwiki.net

  • Mosquito
  • Posts: 6
Re: How to reload a .dll into AutoCAD without closing or restarting
« Reply #9 on: September 11, 2022, 12:53:45 PM »
Hey all, I've been away for awhile, figured it was time to send some responses.
Thanks for the feedback, it is very helpful!
Let's keep the chat going with any new ideas or insights.
Here's a new article to help folks just getting started with this nuget package:
http://www.cadwiki.net/blogpost/nuget-examples-start-here


Cool stuff.
Will this shutdown loaded reactors, or is IExtensionApplication.Terminate() called for the app being unloaded?
I’m not using .net at the moment, just wondering

I haven't added any features to shutdown reactors.
Also, this nuget package doesn't unload anything.
It reloads .dlls into AutoCAD's app domain.

This is a problem people have wanted a solution to, thanks for putting in the effort and sharing.


Yes, but I'm happy restarting and auto-loading the rebuilt assembly.  . . . becoming more patient with age, and use the time to re-evaluate expectations.

Pity it's not in a language I'm more comfortable with.  :)

Jeff H: you're welcome, glad it's useful.
kdub: what langauge would you like to see supported in the future?

This for all autocad version ?
Daboho: I have only tested this on AutoCAD 2021, let me know if you find bugs on other versions.