Emgu.CV Not supported Uri format - c#

I have some program on my 1st pc (everytinh works fine)
but when I copy my full project to another PC and try to run application I get this error :
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: Formaty identyfikatorów URI nie są obsługiwane.
If there is a handler for this exception, the program may be safely continued.
and than:
A first chance exception of type 'System.BadImageFormatException' occurred in Emgu.CV.dll
Additional information: Próbowano załadować program w niepoprawnym formacie. (Wyjątek od HRESULT: 0x8007000B)
If there is a handler for this exception, the program may be safely continued.
in this code:
BackgroundSubtractorMOG2 pMog11 = new BackgroundSubtractorMOG2(0, 80, false);
I have really have no idea what to do with this. What is the problem with Emgu.CV in the 2nd pc?

Related

System.ArgumentNullException in mscorlib.dll

TextWriter textWriter = new StreamWriter(#System.Environment.GetEnvironmentVariable("OUTPUT_PATH"), true);
when I run this, I am getting the following error.
Exception thrown: 'System.ArgumentNullException' in mscorlib.dll An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll Value cannot be null.
How to fix it?
Environment Variable OUTPUT_PATH is not set.
System.Environment.GetEnvironmentVariable("OUTPUT_PATH")
This statement is returning null.
Please check environment variables to confirm if path is correctly set or not.
If path is there, then there may be access privilege issue. Your code may not have permissions to read the environment variable.

Error while drawing shape on Canvas Windows 10 Universal Apps

I am creating an app that draws shapes on canvas and those shapes are recognized as letters using https://github.com/phatware/WritePadSDK sdk for writing pad. but the problem is that this api code works fine when it is used in windows 8.1 project but when the same code is used in windows 10 universal app it produces error when i debugged the code. Code of xaml is given bellow
<Canvas Background="WhiteSmoke" Name="InkCanvas" PointerPressed="OnCanvasPointerPressed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" PointerReleased="OnCanvasPointerReleased" PointerCaptureLost="OnCanvasPointerCaptureLost" PointerExited="InkCanvas_OnPointerExited" PointerMoved="OnCanvasPointerMoved" LostFocus="InkCanvas_LostFocus">
and the code which is recognizes the shape using sdk is given bellow which is executed on PointerReleased event of Canvas:-
var resultValue = recognizerShared.RecognizeStrokes(InkCanvas.Children.ToList(), false);
and when i inspected the method given in sdk i.e. RecognizeStrokes which does the recolonization i got error when i did debugging
As this code works fine in windows 8.1 project i think it can be something todo with windows 10 universal app problem
Excelption details is given bellow:-
AccessKey = 'new System.Collections.Generic.Mscorlib_CollectionDebugView<Windows.UI.Xaml.UIElement>(strokes).Items[0].AccessKey' threw an exception of type 'System.InvalidCastException'
AccessKeyScopeOwner = 'new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0].AccessKeyScopeOwner' threw an exception of type 'System.InvalidCastException'
AllowFocusOnInteraction = '((Windows.UI.Xaml.FrameworkElement)new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0]).AllowFocusOnInteraction' threw an exception of type 'System.InvalidCastException'
AllowFocusWhenDisabled = '((Windows.UI.Xaml.FrameworkElement)new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0]).AllowFocusWhenDisabled' threw an exception of type 'System.InvalidCastException'
ContextFlyout = 'new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0].ContextFlyout' threw an exception of type 'System.InvalidCastException'
ExitDisplayModeOnAccessKeyInvoked = 'new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0].ExitDisplayModeOnAccessKeyInvoked' threw an exception of type 'System.InvalidCastException'
FocusVisualMargin = '((Windows.UI.Xaml.FrameworkElement)new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0]).FocusVisualMargin' threw an exception of type 'System.InvalidCastException'
FocusVisualPrimaryBrush = '((Windows.UI.Xaml.FrameworkElement)new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0]).FocusVisualPrimaryBrush' threw an exception of type 'System.InvalidCastException'
new System.Collections.Generic.Mscorlib_CollectionDebugView(strokes).Items[0].IsAccessKeyScope
Please help me to solve the problem above.
Link to download the sample project code is given bellow for testing where you can see the problem
https://www.dropbox.com/s/1xbtxbxwyoyuf00/WindowsSDK.rar?dl=0
Thanks!

C#, EPPLUS - cannot save_as excel another time

we just have a excelpackage object given, which was saved using SAVEAS(file) correctly. But when I try to save_as another time (after re-arranging worksheets), then it will be thrown this exception:
An unhandled exception of type 'System.InvalidOperationException'
occurred in EPPlus.dll
Error saving file (report.xlsx)
Already using the latest version 4.0.5 EPPLUS.
Also tried the other post without luck:
var reportFileInfo = new FileInfo(reportFile);
if (reportFileInfo.Exists)
reportFileInfo.Delete();
ExcelReportStream.SetLength(0);
ExcelReport.Stream.Position = 0;
ExcelReport.Stream.CopyTo(ExcelReportStream);
using (var excelToSave = new ExcelPackage())
{
excelToSave.Load(ExcelReportStream);
excelToSave.SaveAs(reportFileInfo); <<<<< EXCEPTION again!
}
An unhandled exception of type 'System.InvalidOperationException'
occurred in EPPlus.dll
Error saving file (report.xlsx)
The ExcelPackage is a property and with the first try, it will be ExcelPackage.SaveAs(reportFile) works on first time. But not on second.
No further information from the compiler...
Any ideas?
Thank you.

An unhandled exception of type 'System.InvalidOperationException' occurred in WebDriver.dll

I'm following a selenium C# tutorial and I'm in the first stage. So when I run my console application I got the following error.
An unhandled exception of type 'System.InvalidOperationException'
occurred in WebDriver.dll
Additional information: unknown error: unrecognized Blink revision:
3b3c00f2d95c45cca18ab944acced413fb759311
And in the console it says
Only local connections are allowed
My code
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("http://www.google.lk");
}
}
try downloading the driver and give its path to constructor - LINK
driver = new ChromeDriver(DRIVER_PATH);

Error reading a file and updating a label

Here is the code I am working with:
p = new Process();
p.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + "\\scan.cmd";
p.Start();
p.WaitForExit();
// Read the file and display it line by line.
string line;
System.IO.StreamReader file = new System.IO.StreamReader("\\log.txt");
while((line = file.ReadLine()) != null)
{
itemBeiingScanned_Label.Content = line;
}
file.Close();
When building it runs everything up until this point and then throws two identically worded unhanded exception's:
Exception:
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: The invocation of the constructor on type 'SpywareKing.MainWindow' >that matches the specified binding constraints threw an exception.
If there is a handler for this exception, the program may be safely continued.
Any insight would be appreciated-- I can provide more information if there is something that you need to help with looking into the root of the problem.
Here is some potentially useful information from the debug console in Visual Studio:
'SpywareKing.vshost.exe' (CLR v4.0.30319: SpywareKing.vshost.exe): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll'. Symbols loaded.
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: The invocation of the constructor on type 'SpywareKing.MainWindow' that matches the specified binding constraints threw an exception.
The thread 0x33dc has exited with code 0 (0x0).
An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: The invocation of the constructor on type 'SpywareKing.MainWindow' that matches the specified binding constraints threw an exception.
The program '[13492] SpywareKing.vshost.exe' has exited with code 0 (0x0).
Most probably the line
System.IO.StreamReader file = new System.IO.StreamReader("\\log.txt");
is the cause of the error. You cannot safely assume that the current directory is the one where the log file resides. Always specify the full path.
string logFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.txt")
System.IO.StreamReader file = new System.IO.StreamReader(logFie);
The current directory can change at any time when the user is selecting a directory in a FileOpenDialog or FileSaveDialog. It's not automatically the applications directory. Also the applications directory will be \SolutionFolder\ProjectFolder\bin\Debug when debugging. Is this the directory you are looking for?

Categories

Resources