C# .NET - Could not load file or assembly 'Mono.Security, Version=1.0.5000.0,

Asked By avula on 26-Jan-12 03:02 AM
{System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
File name: 'Mono.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
   at Npgsql.NpgsqlConnection..ctor(String ConnectionString)
   at PostgreSQLTEst.Form1.llOpenConnAndSelect_LinkClicked(Object sender, LinkLabelLinkClickedEventArgs e) in C:\Users\office\Desktop\afppostsrc\PostgreSQLTEst\PostgreSQLTEst\Form1.cs:line 29

=== Pre-bind state information ===
LOG: User = office-PC\office
LOG: DisplayName = Mono.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
 (Fully-specified)
LOG: Appbase = file:///C:/Users/office/Desktop/afppostsrc/PostgreSQLTEst/PostgreSQLTEst/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Npgsql, Version=0.7.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Mono.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
LOG: Attempting download of new URL file:///C:/Users/office/Desktop/afppostsrc/PostgreSQLTEst/PostgreSQLTEst/bin/Debug/Mono.Security.DLL.
LOG: Attempting download of new URL file:///C:/Users/office/Desktop/afppostsrc/PostgreSQLTEst/PostgreSQLTEst/bin/Debug/Mono.Security/Mono.Security.DLL.
LOG: Attempting download of new URL file:///C:/Users/office/Desktop/afppostsrc/PostgreSQLTEst/PostgreSQLTEst/bin/Debug/Mono.Security.EXE.
LOG: Attempting download of new URL file:///C:/Users/office/Desktop/afppostsrc/PostgreSQLTEst/PostgreSQLTEst/bin/Debug/Mono.Security/Mono.Security.EXE.
}
Srikanth K replied to avula on 26-Jan-12 07:21 AM

You must use the Mono.Security.dll file that comes with the Novell.Directory.Ldap.dll you downloaded, otherwise you'll run into binary compatibility issue.

Note that the version number of Mono.Security.dll match the framework version since this assembly is part of the Mono framework where it is used by most of its security tools. As such you cannot go around and look for the file (well you could be lucky, but don't count on it) you need the one that was used to test Novell.Directory.Ldap.dll.

http://stackoverflow.com/questions/7386272/mono-security-load-problem

Danasegarane Arunachalam replied to Srikanth K on 26-Jan-12 11:30 AM
It looks like the application could not able to find the file in the Windows Assembly Folder. Does it happen in development server or in
Deployment. If you are facing the problem in deployment then include the file in deployment from windows assembly folder. If you are facing during development then download the mono from http://www.go-mono.com/mono-downloads/download.htmland reinstall it