You have to register the dll with the gacutil provided with visual studio, the best way to run it is through the visual studio developer command line. The dll will have to have a strong name (this can be added by reccompiling the dll, or you can generate your own if you can dissasemble it and reassemble it, there are instructions to do this). Then you can add the dll to the global cache with this command gacutil /i C:\Windows\somethign\somethgin.dll
How do I get matlab to recognize .net dll
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to access a method in a .net class that opens a file then spits out data. You put the filename in and it gives you data out. I shouldn't have to register this dll with the gac. Why does matlab not load the dll? This is the error:
Error using FileScanner (line 12)
Message: Unable to find assembly 'InstData, Version=1.0.23.0, Culture=neutral, PublicKeyToken=null'.
Source: mscorlib
%**********************.Net Code:%**********************
using System;
namespace CSC.InstData {
static public InstData Open(String filename) {
InstData dataSet = new InstData();
return dataSet;
}
}
}
%**********************Matlab Code:%**********************
dllPath = fullfile(cd,'InstData.dll');
asm = NET.addAssembly(dllPath);
nfile = 'blah.datafile';
nfilePath = fullfile(cd,nfile);
InstClassdata = CSC.InstData.InstData.Open(nfilePath)
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!