Could not load file or assembly 'Mono.Posix' - mono

I'm attempting to run an exe on RHEL 6 using Mono. I've compiled Mono 4.0.2.4 and when I try to run my exe it crashes.
My Command:
/opt/mono/bin/mono /opt/mono/lib/mono/4.5/mono-service.exe -l:plexos.lock ./DALicenseServer.exe
The Error.
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies.
File name: 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies.
File name: 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
I think I have the Mono.Posix.dll file:
ls /opt/mono/lib/mono/4.0/Mono.Posix.dll
/opt/mono/lib/mono/4.0/Mono.Posix.dll

This is a bug (Bug 56787) currently tracked by the Xamarin team. You must download and paste the missing dll in your environment then restart visual studio.
for vs 2015 paste here the dll:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\
for vs 2017 paste here the dll:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Xamarin.VisualStudio
check this link for step by step: https://releases.xamarin.com/common-issues-in-the-xamarin-15-2-2-release-being-tracked-by-the-xamarin-team/

1) Try running mono with trace mode to see if it really is Mono.Posix.dll or a native shared library (.so) that is not being found.
mono --trace /opt/mono/lib/mono/4.5/mono-service.exe -l:plexos.lock ./DALicenseServer.exe
2) Check to see if the assembly has been installed properly in the GAC:
gacutil -l Mono.Posix
The following assemblies are installed into the GAC:
Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
Number of items = 1
3) If the assembly is not found in the GAC, something went wrong during the install (make install) as this assembly is part of the framework install. You can manually assign the MONO_PATH to tell mono where it should find assemblies that are not in the current directory ($PWD) and/or not in the GAC:
export MONO_PATH=/path/to/assemblies:/another/path/to/assemblies:$PATH

Related

Visual Basic Could not load file or assembly 'System.Data.Common, Version=6.0.0.0 error

So, i sent the project directory to my friend, but whenever he runs it he allwys get this error we are trying to search for a solution but we can find any
The error says:
System.IO.FileNotFoundException: 'Could not load file or assembly
'System.Data.Common, Version=6.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system could not find the specified file.'

Autofac and Microsoft.Bcl.AsyncInterfaces

Visual Studio 2019 provides an unannounced 4.700.19.56404 version of Microsoft.Bcl.AsyncInterfaces here:
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Bcl.AsyncInterfaces
Autofac accepts 1.1.0 or greater of this package. However, if I try to update the Microsoft.Bcl.AsyncInterfaces Nuget package to the latest version (5.0.0), I start running into problems where the package gets resolved to the 4.700.19.56404 version because:
21> Dependency "Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
21> Resolved file path is "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Bcl.AsyncInterfaces.dll".
21> Considered "C:\<repo-location>\bin\Debug\Microsoft.Bcl.AsyncInterfaces.dll",
21> but its name "Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
21> didn't match the expected name "Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
And of course when trying to run, I get a runtime error because Microsoft.Bcl.AsyncInterfaces cannot be loaded.
I guess the most obvious question is if there's a way around this via msbuild, e.g., some target that would resolve the dependency at build time to 5.0.0, not 4.700.19.56404.
Otherwise, I think this could be solved by having Autofac updating its Microsoft.Bcl.AsyncInterfaces dependency to 5.0.0 over 1.1.0. Not sure if this is feasible or not.

Package Manager Console not opening

When ever i try to open package manage console from my visual studio 2017(Community) it will give me following error.
Could not load file or assembly 'System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The file or directory is corrupted and unreadable. (Exception from HRESULT: 0x80070570)

Errors while converting .Net Core Web project from VS 2015 to VS 2017

I have ASP.NET Core web project that is developed using VS 2015 Community. The project is using project.json file. The web site is been in production for last few months. Now i have downloaded VS 2017 Community. VS 2017 auto converted the project and but got so many errors on compilation which i could not resolved.
So i created brand new .netcore web project in VS 2017, installed all the dependencies that old project(VS 2015) had ( except the Microsoft.NETCore.App because now it is auto referenced)
Then copied all the C#, js, css, images etc files from old project to new project.
Here are the NugetPackages project is referencing to. The version of the Microsoft.NETCore.App is 1.1.2
Now when i compile new project in VS 2017 i get below errors
Error CS0012 The type 'Object' is defined in an assembly that is not
referenced. You must add a reference to assembly 'mscorlib,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e,
Retargetable=Yes'.
Do i have to reference mscorlib directly? How? Which package has this assembly?
Error CS0012 The type 'HttpStatusCode' is defined in an assembly that
is not referenced. You must add a reference to assembly 'System.Net,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e,
Retargetable=Yes'.
Where is System.Net assembly?
Error CS0433 The type 'HttpResponseMessage' exists in both
'System.Net.Http, Version=1.5.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' and 'System.Net.Http,
Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Error CS0433 The type 'HttpClient' exists in both 'System.Net.Http,
Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and
'System.Net.Http, Version=4.1.1.1, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'
Error CS0433 The type 'HttpClient' exists in both 'System.Net.Http,
Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and
'System.Net.Http, Version=4.1.1.1, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'
How do i find which package has different versions of System.Net.Http installed?
How do i resolve these issues.

IlMerge in VSTO project results in FindRibbons error

I created a fresh VSTO project .NET 4.5.1 (Outlook) and setup IlMerge using the tutorial here.
After the failure I looked in the bin/debug and OutlookAddIn8.dll is there so I'm not sure how it's having a problem finding it. Is there something specific I need to do for VSTO projects?
Error 1 The "FindRibbons" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'OutlookAddIn8, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
or one of its dependencies. The system cannot find the file specified.
File name: 'OutlookAddIn8, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'