I've built a C# COM library dll and have run my matlab code that calls it. It works, but now I want to change the C# code and rebuild it. MSVC says:
error MSB3021: Unable to copy file "obj\Debug\M2_Socket_cSharpLib_Matlab.dll" to "bin\Debug\Socket_cSharpLib_Matlab.dll". The process cannot access the file 'bin\Debug\Socket_cSharpLib_Matlab.dll' because it is being used by another process.
Done building project "M2_Socket_cSharpLib_Matlab.csproj" -- FAILED.
How do I get Matlab to stop using the dll so that I can rebuild it?
(my current solution is to restart matlab....Arg.)
Cheers
How are you calling it ... through loadlibrary? If so, have you tried unloadlibrary?
James Tursa
I'm using COM to allow Matlab to call the MSVC compiled C#. I do this by running regasm to register it (I got the code from here: http://www.mathworks.com/matlabcentral/fileexchange/16549).
Then I use activexserver
net = actxserver('Socket_cSharpLib_Matlab.PingIpAddr'); % Load the ActiveX ComMatlab
But you made me think of trying to use "release". In which case I thought I first had to get the handle using
K>> h = actxGetRunningServer('Socket_cSharpLib_Matlab.PingIpAddr');
??? Error using ==> actxGetRunningServer
The server 'Socket_cSharpLib_Matlab.PingIpAddr' is not running on this system.
But that didn't work as you can tell.
Cheers