Re: NET.addAssembly warnings
- From: Chitra Kalluri <chitra.kalluri@xxxxxxxxxxxxx>
- Date: Fri, 25 Sep 2009 14:04:06 -0400
Joel wrote:
I have a top-level script that calls a function, both of which use .NET. So both of them call NET.addAssembly to load the specific assemblies they need.Hi Joel,
The problem is, every time I run the script, I get a load of warnings from the inner function, saying that the particular assembly is already loaded.
Is there a way to hide these warnings, or detect if an assembly is already loaded before loading it again?
Here's a sample warning:
Warning: Assembly '<assemblyName>' has already been added from
location '<assemblyDir>'.
Thanks.
You can use the LASTWARN function in MATLAB to get the message identifier for the last warning message displayed in MATLAB. You can then use this identifier and turn the warning off with the WARNING method.
To view a list of assembles currently loaded into MATLAB, you can use AppDomain.GetAssemblies as follows
function listAssemblies
% View assemblies currently visible to MATLAB
domain = System.AppDomain.CurrentDomain;
assemblies = domain.GetAssemblies;
for i= 1:assemblies.Length
asm = assemblies.Get(i-1);
disp(char(asm.FullName));
end
end
You can tweak the above function so that it performs a check for whether or not your assembly is currently loaded.
HTH,
Chitra.
.
- References:
- NET.addAssembly warnings
- From: Joel
- NET.addAssembly warnings
- Prev by Date: Re: Is it a bug or what is it?
- Next by Date: Re: infrared image segmentation
- Previous by thread: NET.addAssembly warnings
- Next by thread: Vectorizing .NET lists?
- Index(es):
Relevant Pages
|