I want to force the AppDomain being used by SQLCLR to be reset. How can I do that besides restarting the SQL Server instance?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I know this is a bit brutal, but what about disabling the CLR and re-enabling it?
There is a more elegant solution that won't affect all other assemblies: just change the PERMISSION_SET of one of the assemblies in the app domain (app domains are per user).
Just remember that you will need to set the PERMISSION_SET back to what it was. Also, you need to access a method in the assembly before changing the PERMISSION_SET will unload it; changing an assembly that is not currently loaded into an app domain that is active, but with another assembly, has no effect on the app domain (App Domains are per-DB, per-User, not per-Assembly).
In this case you can simply turn the
If you only have one App Domain in the database anyway (and I suspect this is the case 95%, or more, of the time), then both of the methods described here have the same net effect. And in that situation, the
ALSO, if you only have a single App Domain then the