NET assembly unload conundrum
이전 댓글 표시
I am trying to develop a C# class in Visual Studio and test it in Matlab. I can load the NET assembly and use it okay, but a problem arises if I change the NET code.
If I load the NET assembly into Matlab from the Visual Studio debug folder I can't rebuild the assembly in Visual Studio.
If I copy the dll into a local folder and load into Matlab from there I can only load once. Subsequent times I get the following error: "The process cannot access the file because it is being used by another process." In other words it won't let me copy the new dll because the old one is still in use.
So at the moment if I change the assembly code I have to close Matlab and reopen it to test the new assembly. This is adding quite a lot of time to my development.
I believe my version of Matlab (2010a) cannot unload NET assemblies. Does anyone know of another way around this?
채택된 답변
추가 답변 (5개)
Cameron
2016년 2월 2일
0 개 추천
I am also having this same problem with R2015b. Any resolution??
Ivan
2016년 7월 19일
0 개 추천
The same problem in R2016a
imme werus
2017년 4월 24일
편집: imme werus
2017년 4월 24일
0 개 추천
I think it is also the same for 2016b, is that true ?
Markus Finkeldey
2017년 10월 10일
편집: Markus Finkeldey
2017년 10월 10일
0 개 추천
It seems that the .NET support of Matlab is very limited even in R2017a, makes it a hell of a workload if you want to access a c# library instead of a pure c library.
Travis Leith
2019년 10월 30일
0 개 추천
This is still an issue going into 2020 :(
댓글 수: 3
Paul Kelly
2019년 10월 30일
Roofus Milton
2019년 11월 15일
Yup. Wolfram has great integration. I suspect their approach creates a new AppDomain and subsequently loads the requested assemblies. LINQPad has remained my default testing tool.
Carlo
2024년 2월 16일
Still a problem in matlab 23!
카테고리
도움말 센터 및 File Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!