VB.NET desktop application error : Could not load file or assembly 'log4net, Version = 1.2.10.0 Culture = neutral, PublicKeyToken = 692fbea5521e1304' - vb.net

I've setup a VB.NET desktop application in a Windows 8.1 pro 64-bit PC. After doing server configurations I'm trying to login to the application. It's when I'm getting the following error message:
Could not load file or assembly 'log4net, Version = 1.2.10.0 Culture = neutral, PublicKeyToken = 692fbea5521e1304'or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I've installed SAP Crystal Reports 13.0.3 64-bit yet it's still not working.
What is the reason behind this problem?

Check you Application files in Project Settings,find status of log4net dll whether included or not .Make it included in your project as below :

Problem solved.
The problem raised due to the mismatch in version of the log4net.dll file. My solution had log4net version = 1.2.9.0, while it needed the version = 1.2.10.0, hence the exception occured. I replaced the existing log4net.dll file with the one which has appropriate version and the problem was solved.

Related

MTOUCH: Error MT0009: Error while loading assemblies: grpc_csharp_ext.x64.dll (MT0009)

I get a build error using Visual Studio for Mac with an iOS project. It also occurs in an Android project on Mac and in an iOS project in Visual Studio 2019 on Windows 10.
I was able to run the project when on an iPhone 8 when it was "clean", before I put any code in it.
Here is the error:
/Users/shinehah/VSProjects/iOSAppSpeechToText01/iOSAppSpeechToText01/MTOUCH: Error MT0009: Error while loading assemblies: /Users/shinehah/.nuget/packages/grpc.core/1.18.0/runtimes/win/native/grpc_csharp_ext.x64.dll (MT0009) (iOSAppSpeechToText01)
Here are the warnings:
/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3277: Found conflicts between different versions of "System.Numerics" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. (MSB3277) (iOSAppSpeechToText01)
/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3277: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. (MSB3277) (iOSAppSpeechToText01)
/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. (MSB3277) (iOSAppSpeechToText01)
/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190. (MSB3276) (iOSAppSpeechToText01)
/Users/shinehah/VSProjects/iOSAppSpeechToText01/iOSAppSpeechToText01/ViewController.cs(33,33): Warning CS1701: Assuming assembly reference 'Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' used by 'Google.LongRunning' matches identity 'Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' of 'Google.Protobuf', you may need to supply runtime policy (CS1701) (iOSAppSpeechToText01)
/Users/shinehah/VSProjects/iOSAppSpeechToText01/iOSAppSpeechToText01/ViewController.cs(29,29): Warning CS1701: Assuming assembly reference 'Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' used by 'Google.LongRunning' matches identity 'Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' of 'Google.Protobuf', you may need to supply runtime policy (CS1701) (iOSAppSpeechToText01)
The error occurs last, after the warnings.
I didn't add any code whatsoever. The only difference is that I installed Google.Cloud.Speech.V1.
That's everything I changed after a new clean project.
I have tried using Google.Cloud.Speech.V1 1.0.1 package instead of 1.1.0, but I get the same error.

docx4j.NET installation issue

I've installed docx4j.NET 3.0.1 from Nuget with vs2012.
When I try to use the library with this call
WordprocessingMLPackage.load(inputS, "");
I receive this error:
System.TypeInitializationException:
The type initializer for 'org.docx4j.openpackaging.packages.OpcPackage' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'slf4j-api,
Version=1.7.6.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies
The version of slf4j-api in the docx4j.net 3.0.1 distribution is 1.7.5.0.
Is there a problem in the distribution of package?
Check that the list of referenced DLLs in your VS project includes slf4j-api. If not, add it.
If you have the DLL properly referenced, then as per the sample code in say https://github.com/plutext/docx4j.NET/blob/master/docx4j.NET/src/samples/c%23/Docx4NET/DocxToHTML.cs, you might need something like (note the bottom line):
// Programmatically configure Common Logging
// (alternatively, you could do it declaratively in app.config)
NameValueCollection commonLoggingproperties = new NameValueCollection();
commonLoggingproperties["showDateTime"] = "false";
commonLoggingproperties["level"] = "INFO";
LogManager.Adapter = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter(commonLoggingproperties);
ILog log = LogManager.GetCurrentClassLogger();
log.Info("Hello from Common Logging" );
// Necessary, if slf4j-api and slf4j-NetCommonLogging are separate DLLs
ikvm.runtime.Startup.addBootClassPathAssembly(
System.Reflection.Assembly.GetAssembly(
typeof(org.slf4j.impl.StaticLoggerBinder)));

Where to find the System.management dll

I am trying to build an SQL CLR stored procedure that references an IBM WebSphere MQ dll. I'm having problems doing this on my work machine, so I decided to see if I could just get this to work on my home comp using localhost. I've made progress in getting a different error, however I'm not sure where the system.management dll is located...
Here is a copy of the error message:
Msg 10301, Level 16, State 1, Line 1 Assembly 'amqmdnet' references assembly 'system.management, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.
This is installed in GAC, Check the version of .Net that you have it on your system
You must register this assembly in SQL Server
create assembly [System.Management]
from 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll'
with permission_set = unsafe

dll not loading- FileLoadException

The problem I am having is that I am getting a System.IO.FileLoadException when trying to load the RWLock.dll on a test box and Windows xp machines.
This is the exception that is thrown when it tries to load the dll on the windows 2003 server machine (most likely 32 bit):
System.IO.FileLoadException: A procedure imported by 'rwlock, Version=1.0.3889.27926, Culture=neutral, PublicKeyToken=null' could not be loaded.
File name: 'rwlock, Version=1.0.3889.27926, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x8007007F): The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)...
However, we have not had any problems trying to run this on a Windows 2007* server machine (64 bit).
Any ideas? Thanks in advance :)
*windows 2008(oops)
The error message is telling you that RWLock.dll tries to import a function that doesn't exist from another DLL. This probably means that RWLock is trying to import an API function that exists on the (I presume you meant instead of "Windows 2007 Server") Windows 2008 Server machine, but not on Windows 2003 or earlier.
You can use Dependency Walker to figure out what it's trying to load and where it's trying to find that missing function, but it won't help make it available on the Windows versions where it doesn't exist.
The other possibility is that RWLock has a dependency on another DLL that it provides, but you're not re-distributing it properly. Dependency Walker can help with this, too.

Upgrading App from .NET 3.5 to 4.0, COM fails now

I have an application that I am upgrading from the .NET 3.5 to the .NET 4.0 framework. It uses a COM library which is referenced. It works no problem in 3.5 but after converting to 4.0 I have issues getting the COM to work. The COM is from a 3rd party so we didn't develop it ourselves.
I get the following COM error (generic COM error, not specific to the COM object itself): hr = 0x8007000b
CLR gives me: 'The invocation of the constructor on type 'Skype_Business_Launcher.Main' that matches the specified binding constraints threw an exception.' Line number '3' and line position '5'.
And the C# logs:
=== Pre-bind state information ===
LOG: User = \phillip
LOG: DisplayName = Interop.SKYPE4COMLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Skype Business Launcher, Version=1.0.5.0, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context.
LOG: Using application configuration file:
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///bin/Debug/Interop.SKYPE4COMLib.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
I removed the pathname for security reasons but I have checked all the path information and it's all correct. Also the COM library file exists where it's pointing to. It's also copied to the OBJ folder within the project as well.
Originally I was getting an error about the COM library not supporting embedded types so I made "Embed Interop Types" false (it was true below) and the error went away but I'm not sure if thats connected to this error or not so I thought I'd mention it just in case.
Again, it works just fine with 3.5.
Thanks,
A shot in the dark: it looks like you are using the x64 version of the framework. Was that already the case with 3.5 ? And is the COM server a DLL or an EXE ?
If the COM server is a DLL, there needs to be a "bitness" match between the DLL and your program.
when you convert your project to 4.0 the IDE can perform a issue to convert COM library into 4.0.
when you convert your project to 4.0 remove com library then Re include it in your project then i thing it should be works.