How to configure matlab toolbox when I use c# both? - c#

I'm trying to use the Neural Network of matlab in c#.I have compiled the code to .Net Assembly then I call the matlab functions in c# ,and then I got the Exception:
... MWMCR::EvaluateFunction error ...
Error using nnetParamInfo (line 28)
FCN is not the name of a function on the MATLAB path.
the exception throwed at the line that I simply create a network:
net = elmannet();
So, I think this problem is due to the wrong path configuration of toolbox.
I tried to issue path command in Matlab and got a long list of toolbox and other things.
How can I solve this problem?
Any help will be appreicated !!

Not all of Neural Network Toolbox is supported by the deployment products, including MATLAB Builder for .NET. See the Compiler Support page for details. In particular, you can only deploy functions that apply pre-trained networks - you can't deploy the functions that create or train new ones.

Related

Loading a C# class in R 3.6.x

I have a solution that is built in Visual Studio 2019 using C# 3.5.0. I have my mother application that is coded with RStudio running R3.6.x. My objective is to use the solution (Project files are with me) and integrate with R. The input data flows from R and uses the C# code to produce the intermediate outputs.
My attempts:
1. I tried dyn.load to build the dll but it fails with "module not found" error message.
2. I did not find ".cs" as one the objects accepted by shlib cmd tool for building R loadable dll packages.
2. Tried to install rClr and it failed as there is no library for R3.6.x
So the challenge is to find an efficient way to load the COM object in R 3.6.x. Suggestions welcome.
You might want to take a look at Exporting a C# function. This will only allow c-style function calls. There are also R-Interop that uses named pipes for communication. A third way might be to use Component object model.

IronPython.Runtime.Exceptions.ImportException: 'No module named pandas'

I am running C# project which use result of python file. I'm using IronPython to run python file in visual studio. But the error above come up. Please help me. Many thanks!
Sorry you cant access third party functionalities/packages (like Pandas here)
The reason:
Pandas / numpy use great parts of c code, that is a no good for IronPython (.NET).!!!!
If you need to use the power of pandas, i suggest you to create a dialog (send/reveive datas or by file or by calling an external python prog) between your IronPython Project and a program python including pandas.

Trying to connect a ergometer to pc using a SDK but program can't find dll

I'm trying to connect the concept2 ergometer with a PM4 with a computer so I can use it's input in a game made in Unity3D.
The company of the ergometer provides a SDK that's in C++ (I don't have experience with C++).
I'm using this code to wrap the C++ code in C#.
Here I replace "RPPM3DDI.dll" with "PM3DDICP.dll" and "RPPM3Csafe.dll" with "PM3Csafe.dll".
When I run the code the program throws the following exception:
System.DllNotFoundExeption for DLL PM3DDICP.dll
I put the files of the SDK in the solution folder so that's not it I guess...
So I read (on stackoverflow) that there can be problems with the dependencies and I used DependencyWalker. I got a ton of messages of missing dependencies but it turns out that DependencyWalker is not being maintained and some changes in Windows are causing the missing dependency reports...
The goal is to get the speed that a person is rowing with and use it in Unity3d.
The questions now are:
How can I use this SDK when he can't find the dll file?
How can I locate the dependency issues among all the 'fake' missing dependencies?
I found the problem and I thought: maybe this answer is usefull for someone else too.
The problem was that I put the SDK files in the wrong folder (noob mistake I know...).
I needed to put the files in: Project folder -> bin -> Debug
I couldn't find this solution on the internet

C# ActiveX error during creation

I've faced with following problem:
I have an ActiveX Control , on dev machine it is working as expected ,
when trying to create it on other machine I am getting the following error
Error: The system cannot find the file specified.
I am using following line to create it:
var activeX = new ActiveXObject("ScannerViewerControl.ScannerViewer");
I've used installshield for deployment , and marked .NET Com Interop.
I am able to find in registry path to the .dll under HKEY_CLASSES_ROOT.
What am I missing ???
You are probably missing a dependency for the active-x DLL on the client machine. Depending on what version of VS you have installed, you might have a tool called depends, which you can point at a DLL and see the dependencies that are required.

Howto successfully register certadm.dll in order to be able to use ICertView2 in C# Code

Motivation:
I want be able to retrieve and view Certificates from a Windows CA on a local Machine. I don't want to access the Browser-Keystores of the Machine, but the Windows CA (Windows Certifcate Authority (Service)).
I want to to do this in C#-Code.
My Investigation so far:
I found several Examples that are using the following line:
ICertView2 certView = new CERTADMINLib.CCertView();
...
I think i'm able to use this line and the ICertView2 Structure, i reached my Goal.
If a write this Line into my C#-Code in Visual Studio, it says to me, that it don't know ICertView2 and CERTADMINLib.
So if searched the Web again and found out the i need to import a Reference. I need the COM Library certadmin.dll, that fortunately exists in my C:\Windows\System32 Folder.
So i tried to add the Reference over the Solutionexplorer->Project->References->Add Reference->COM. But it is not listed there, only a similar looking Library called "CertCli 1.0 Type Library". I added this and also was able to type an
using CERTCLIENTLib;
but unfortuneatly, the needed "ICertView2" Class is not in there.
If i type
using CERTADMINLib;
that should be typed in order to be able to use the ICertView2, Visual Studio says to me, that it also don't know "CERTADMINLib".
Further i found hints on the net, that one need to register the certadm.dll beforehand, in order to make it available in Visual Studio. I tried to register the dll-File, but it doesn't work.
If i invoke the following Command:
C:\Windows\System32>regsvr32.exe C:\Windows\System32\certadm.dll
and get a Dialogbox telling me the following:
'Error while loading the Module "C:\Windows\System32\certadm.dll". ... The specified Module could not be found.'
The Version of certadm.dll ist "5.2.3790.3959".
I'm using "Windows 7 Enterpise SP1".
Can you tell me, how i'm able to register and futher make the appropriate Reference available in Visual Studio?
If i've forgotten further Information, please let me know, so i can add them.
Microsoft changed much from XP to Win7. To be able to reference it you will have to tlbimp certadm.dll. Tlbimp.exe can be found in your .NET SDK's and such. Then you will have to import this library in your .NET solution.
Although i have to warn you, i have not mangaged to get any code working in Win7 that works in XP.
You can also look at this link:
http://blogs.msdn.com/b/alejacma/archive/2012/04/04/how-to-get-info-from-client-certificates-issued-by-a-ca-c-vs-2010.aspx

Categories

Resources