Unhandled exception in mono while running NancyFx - c#

I'm running Ubuntu 12.04 and I have the mono-runtime package installed. On my windows machine my NancyFx self hosted application compiles fine with 1 warning but when I try to run it on my VPS I get the following error:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one
of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load
file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
Any ideas on how I can fix this?

I ran across the same problem when trying to run a Mono app (compiled in Xamarin Studio on my Windows machine) on an Ubuntu 14.04 Docker virtual. I did the same thing as you and installed mono-runtime, and after an hour or two of searching, was able to get it to work after installing mono-complete. However, that also brings down a few hundred MB of additional stuff. Finally I found the package that did the trick: libmono-system-core4.0-cil (see here).
Hope that helps!

The Mono version available in the Ubuntu 12.04 repositories is very old. Try with a newer Mono (e.g. the one in Ubuntu 14.04) and see if that works.

Related

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime.WindowsRuntime

I am running a UWP app for windows iot core. I dropped in some code from a .net framework. I have converted most of the errors that occurred (most was compatible with the new update build 16299). I am now getting the error
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.'
I keep seeing in some of the nuget packages i have installed:
Microsoft.NETCore.UniversalWindowsPlatform v6.0.6 that
System.Runtime.WindowsRuntime (>= 4.0.11) is covered.
I am not sure why it is looking for v 4.0.0.0.
Saw this thread but its slightly different: UWP application: Could not load file or assembly 'System.Runtime.WindowsRuntime, Version=4.0.14.0
Does anyone have any ideas?

'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I am a newbie and just created a new project of type: ASP.NET Core Web Application (.NET Core) and let VS preload all the defaults. I changed nothing, except set index.cshtml the startup. It built ok, but has a run-time error of:
System.IO.FileNotFoundException occurred
HResult=0x80070002
Message=Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Call Stack (last item):
ntdll.dll!NtWaitForSingleObject() Unknown
What is happening here, and how can it be fixed?
Using Visual Studio Installer, selecting the Repair option solved the problem.

mod-mono-server4 assembly System.IO.FileNotFoundException

I serached but I didn't found how to resolve this problem. I have ASP.NET application with System.Web.DataVisualization.dll. Dll is in bin folder, simple ASP.NET apps are working but when I try to run this application I got error:
System.IO.FileNotFoundException Could not load file or assembly
'System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35' or one of its dependencies
also I have MONO_PATH=/usr/lib/mono/gac:/app_dir/bin

Passing the paths of nuget installed assemblies to mono runtime

I have Visual Studio project that I am trying to get running with Mono.
I could install all dependencies using
mono nuget.exe install
and compile my application using
mcs -r:RestSharp.105.2.3/lib/net46/RestSharp.dll \
-r:JWT.1.3.4/lib/3.5/JWT.dll \
-r:jose-jwt.2.2.0/lib/net461/jose-jwt.dll \
-r:Newtonsoft.Json.10.0.1/lib/net45/Newtonsoft.Json.dll \
Program.cs
Now I am trying to run the application using
mono Program.exe
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.
File name: 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.
File name: 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
So how do you pass the path to the assemblies to the Mono runtime similar to the compiler?
I tried to set $MONO_PATH but this is not working and not recommended for Production.
The overall question how the mcs compiler and the mono runtime could get the information directly from the installed packages (using nuget.exe).

Windows application error after install

I'm getting the following error after install my windows application to client machine.
But it works properly in my development machine.
System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The
system cannot find the file specified. File name:
'Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c'
Thanks in advance.
You need to install the Office Interop assemblies on the target machine. They're available for download as a redistributable from the link below
http://www.microsoft.com/en-us/download/details.aspx?id=3508

Categories

Resources