Matlab dll included in C# project on client pc - c#

I'm working on Matlab and C# projects, I've created a DLL file from the Matlab project and run it on the C# project.
My code works fine on my computer and on any Windows 7 x64 bit that I've tested.
The problem is with Windows 8, When I'm trying to run my app on Win 8 PC the app collapsed while calling to the main class that included in the DLL.
I tried to catch the error, but no error occurred, the app just crashed.
I've already installed MCR for the specific Matlab version, but it still doesn't work.
I believe that I'm missing some system configuration, can someone help to do some order what exactly should I do in order to run it?
UPDATE1:
The code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using VisionCameraQA;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
namespace VisionCameraQATest
{
public partial class Form1 : Form
{
cls_Main main;
public Form1()
{
InitializeComponent();
try
{
main = new cls_Main();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString())
}
}
}
}
The app crashes while getting to main = new cls_Main();, it is not reached to the catch at all.

Related

Cant open the designer on a new project after a new install [duplicate]

This question already has an answer here:
Visual studio does not open the graphical editor for Winforms anymore
(1 answer)
Closed 3 years ago.
I installed Visual Studio 2019 Community completly new today and wanted to make a simple form. To do so I created a new "Windows Forms App (.NET Core)" in C#.
The problem is that I cant open the Designer. If I try to it always takes me to the code editor which just shows me the code editor with the following code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Tic
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
I have already tried uninstalling installing and making a few new projects. Always the same problem. I didnt alter any code.
Most recent update on the same was listed in the designer release note. Try installing the windowsformdesigner setup, and can be found here

Console dialog missing during debug in Visual Studio 2017

I recently started working with Visual Studio 2017. Jumping from 2010.
I created a new, very basic, console application and I am trying to test. The code runs fine but I am not seeing a console dialog anywhere (I have breakpoints and also a Console.Read()). I checked 'behind' all the windows. See nothing in the task tray.
Any ideas? Any new settings that I am not aware of?
Here is all of the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleTest2
{
class Program
{
static void Main(string[] args)
{
Console.Read();
}
}
}
Definitely a console application.
Project Info

Sikuli error in c# with Sikuli integrator package

When I run this code:
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using Sikuli4Net.sikuli_REST;
using Sikuli4Net.sikuli_UTIL;
using SikuliModule;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Sikuli
{
class Program
{
static void Main(string[] args)
{
driver = new ChromeDriver();
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("https://www.google.co.nz/");
Thread.Sleep(2000);
String image = #"C:\Users\safa\Desktop\gmail.jpg";
SikuliAction.Click(image);
}
}
}
I got this exception:
System.ComponentModel.Win32Exception:
'The system cannot find the file specified'
I changed file location but again I got same error.
This the image that I want to click on:
Run the visual studio as administrator using below steps
Click on start(windows) button
Type Visual Studio
Mouse Right Click on Visual Studio
Click on Run as Administrator option
I think there is no mistakes in code. So try this once.
Increase the wait time to 5000ms
For this program you don't need Sikuli4Net, remove usings related to that

Where are the `HttpContext.IsWebSocketRequest` property and the `HttpContext.AcceptWebSocketRequest` method?

I'm trying to get a simple "Hello World" type WebSocket server running on my Mac using Visual studio for Mac OS X.
Where are the HttpContext.IsWebSocketRequest property and the
HttpContext.AcceptWebSocketRequest method? The documentation appears to say they are in HttpContext inside the System.Web dll but I've referenced that (as well as System.Net) and Visual studio can't find them.
Is there something I'm missing or have forgotten?
This is the code I've that's giving me problems.
using System;
using System.Web;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Net.WebSockets;
using System.Collections.Generic;
public void ProcessRequest(HttpContext context)
{
if (context.IsWebSocketRequest)
context.AcceptWebSocketRequest(HandleWebSocket);
else
context.Response.StatusCode = 400;
}
The sample I'm following is: https://github.com/paulbatum/WebSocket-Samples/blob/master/AspNetWebSocketEcho/EchoHandler.ashx.cs
As far as I remember is not supported yet: http://go-mono.com/status/status.aspx?reference=4.5&profile=4.5&assembly=System
You can use one of the many third-party components available for Mono. I develop and maintain one of them https://github.com/vtortola/WebSocketListener

The browser freezes and html page is non-interactive

I am new to using CEF Sharp. So I went to the github.io page which pointed me to this setup tutorial
Having setup my project using Nuget, which installed CEF 47. I ran the project (which simply opened Chromium browser in a WinForm with http://www.google.com). The browser opened up fine but then I could not interact with the page. I could not select the text box or click on the html buttons. When I tried to resize the browser, the app froze and I had to stop the debugger to get out of it.
Am I missing something?
Here is the code,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace CEFRetest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitBrowser();
}
public ChromiumWebBrowser browser;
public void InitBrowser()
{
Cef.Initialize(new CefSettings());
browser = new ChromiumWebBrowser("www.google.com");
this.Controls.Add(browser);
browser.Dock = DockStyle.Fill;
}
}
}
Another thing that I noticed, is that the dlls (libcef.dll, icudtl.dat, CefSharp.BrowserSubProcess.exe, CefSharp.BrowserSubProcess.Core.dll) are not in my bin/Debug directory when I install CefSharp.WinForm using Nuget Package Manager. I only references that are added from Nuget are CefSharp, CefSharp.Core and CefSharp.WinForms.
Could that be a problem?
UPDATE
Ok so it seems I have the required dlls and files but they are in bin\x64\Debug.

Categories