I've got mono 3.2.3 installed. When I try to run a Winforms application - even one as simple as the default template when creating a new project - mono exits immediately with exit code 1 without doing anything, and with no output. Console Applications work fine.
This is from trying to run it in Cygwin:
By changing the project's Output Type to Console Application I got error messages in the console.
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeEngine ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.ThemeWin32Classic ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /tmp/install/lib/libgdiplus.so
Googling that lead me to a page in mono's bug tracker: https://bugzilla.xamarin.com/show_bug.cgi?id=8309
Apparently, this bug was already fixed a year ago, but only merged into mono 3.4.0. The workaround is to edit the file
$MONO/etc/mono/config
and remove the two offending lines:
<dllmap dll="gdiplus" target="/tmp/install/lib/libgdiplus.so" />
<dllmap dll="gdiplus.dll" target="/tmp/install/lib/libgdiplus.so" />
This fixed the issue.
Related
After I use my code when Ranorex is installed is works fine, but after uninstalled it, I have a library of Ranorex payed version, but I don't install it on my PC, just I need the library. there an exception showed with this line of code
Form form = Host.Local.FindSingle<Ranorex.Form>("form[#processname='" + pr.ProcessName + "']");
On debug Mode shows ;
'Host.Local' threw an exception of type 'System.TypeInitializationException'
Exception :
Exception thrown: 'System.TypeInitializationException' in Ranorex.Core.dll
Additional information: The type initializer for
'Ranorex.Core.ElementEngine' threw an exception.
For Ranorex and it's components to work atleast Ranorex Runtime Licencse is required.
I'm working on a project that requires curve-fitting. To get best results I opted to use MATLAB toolkit. I created a dll of this code and tried to use it in C# .NET framework. The dll works successfully on one system but not on any other system.
I get the following exception:
Unhandled Exception: System.TypeInitializationException: The type initializer fo
r 'curve.cfit' threw an exception. ---> System.TypeInitializationException: The
type initializer for 'MathWorks.MATLAB.NET.Utility.MWMCR' threw an exception. --
-> System.TypeInitializationException: The type initializer for 'MathWorks.MATLA
B.NET.Arrays.MWArray' threw an exception. ---> System.DllNotFoundException: Unab
le to load DLL 'mclmcrrt7_17.dll': The specified module could not be found. (Exc
eption from HRESULT: 0x8007007E)
at MathWorks.MATLAB.NET.Arrays.MWArray.mclmcrInitialize2(Int32 primaryMode)
at MathWorks.MATLAB.NET.Arrays.MWArray..cctor()
--- End of inner exception stack trace ---
at MathWorks.MATLAB.NET.Utility.MWMCR..cctor()
--- End of inner exception stack trace ---
at curve.cfit..cctor()
--- End of inner exception stack trace ---
at curve.cfit..ctor()
I wanted to know why this is happening and how I can solve this issue? I need to deploy my project on multiple machines. What should I do?
thank you in advance :)
The error tells you that the program could not find mclmcrrt7_17.dll. This is part of the MATLAB compiler runtime that you need to deploy on each target machine. It looks like you have not deployed the MATLAB compiler runtime.
The runtime redistributable file is available here: http://www.mathworks.co.uk/products/compiler/mcr/index.html
I'm trying to use an external library with my code. I have added it as a reference from within Visual Studio and things like auto-complete works fine, I can see all the available methods while typing code. It also compiles without any warning or errors.
The DLL is within the same directory as the executable.
However, I get this error:
"Unhandled Exception: System.TypeInitializationException: The type initializer fo
r '<Module>' threw an exception. ---> System.DllNotFoundException: Unable to loa
d DLL 'yeppp': The specified module could not be found. (Exception from HRESULT:
0x8007007E)
at Yeppp.Library.yepLibrary_Init()
at Yeppp.Library.Init()
at .cctor()
--- End of inner exception stack trace ---"
What am I doing wrong?
http://docs.yeppp.info/cs/index.html#GettingStarted
You also need to deploy yeppp.dll as the article says.
I have an application hosted in iis. Very occasionally (every month or two) the following exception is thrown:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for "System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory" threw an exception. ---> System.MissingFieldException: Field not found: ?.s_webServicesFactoryType.
The application is set to automatically recycle every day and it seems sometimes after a recycle this exception is thrown repeatedly until the next recycle.
The only hit I can find on google is http://mcfunley.com/135/bizarro-typeinitializationexception-in-systemruntimeremoting, which describes the exact same problem but there doesn't seem to be a solution posted.
Has anyone experienced this before?
Thanks in advance.
We have over 1000 unit tests. A while ago 18 of them started to fail when they were run together with the other tests. These tests run a windows workflow.
If they are run alone they pass.
The error appears to be that it cannot find the connection string.
It cannot find the connection string because it does not know which config file to look in.
It does not know which config file to look in because it cannot find the application context
And it cannot find the application context due to a compilation lock.
Anybody have any idea what could be wrong, and how to fix this? The error I am getting is:
Message: Exception message: The
supplied connection string is not
valid, because it contains
insufficient mapping or metadata
information. Parameter name:
connectionString Inner exception :
System.InvalidOperationException:
Unable to determine application
context. The ASP.NET application path
could not be resolved. --->
System.Reflection.TargetInvocationException:
Exception has been thrown by the
target of an invocation. --->
System.Web.HttpException: The type
initializer for
'System.Web.Compilation.CompilationLock'
threw an exception. --->
System.TypeInitializationException:
The type initializer for
'System.Web.Compilation.CompilationLock'
threw an exception. --->
System.NullReferenceException: Object
reference not set to an instance of an
object. at
System.Web.Compilation.CompilationLock..cctor()
--- End of inner exception stack trace --- at System.Web.Compilation.CompilationLock.GetLock(Boolean&
gotLock) at
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
Thanks
Shiraz
Since you mention that your tests run a WF workflow, I would guess that a previous test run has one or more workflow instances that still run on a thread somewhere, thus locking the compiler because the assemblies are still loaded in a process somewhere.
Can you open Task Manager and investigate whether there's a running process that still uses the workflow somewhere? If so, kill it and see if you can't compile.