getting TypeInitializationException Oracle.DataAccess - c#

I have Windows 10 machine. In that I am running a c# project which references Oracle.DataAccess.dll. I have installed ODAC112012_32Bit. There is a dll NexFen.FirmLoad which accesses Oracle dll. When I run the project I get following error:
System.TypeInitializationException: The type initializer for
'NexGen.FirmLoad.AppUtils' threw an exception. --->
System.IO.FileLoadException: Could not load file or assembly
'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral,
PublicKeyToken=89b483f429c47342' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) --->
System.IO.FileLoadException: Could not load file or assembly
'Oracle.DataAccess, Version=4.112.1.2, Culture=neutral,
PublicKeyToken=89b483f429c47342' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) --- End of inner
exception stack trace --- at NexGen.FirmLoad.AppUtils..cctor()
--- End of inner exception stack trace --- at NexGen.FirmLoad.LoadFirmware.d__0.MoveNext()

Check that your project meets all the following conditions:
You have an Oracle client installed (e.g. Oracle Instant Client)
Oracle.DataAccess.dll and the Oracle Client and the compile target of your application have all the same architecture (i.e. 32-bit vs. 64-bit)
Version of Oracle.DataAccess.dll is the same version as your Oracle client (even the minor version has to match). Your error message indicates version 4.112.3.0 and 4.112.1.2, perhaps there is your problem. Check installed versions in your GAC and Policies.

Related

Installer for Win Form App with drivers and dependencies

I am trying to make an installer for an open source app called mission planner. I've had some features and so on but now I can't make an installer for it. The problems are :
I need the installer to install drivers too and I don't know how to do this.
For now when I run the app on the new machine the script stop with the error
System.TypeInitializationException: The type initializer for
'MissionPlanner.MainV2' threw an exception. --->
System.BadImageFormatException: Could not load file or assembly
'System.ValueTuple, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference
assemblies should not be loaded for execution. They can only be loaded
in the Reflection-only loader context. (Exception from HRESULT:
0x80131058) ---> System.BadImageFormatException: Cannot load a
reference assembly for execution. --- End of inner exception stack
trace --- at MissionPlanner.MAVLinkInterface..ctor() at
MissionPlanner.MainV2..cctor() --- End of inner exception stack trace
--- at MissionPlanner.MainV2..ctor() at MissionPlanner.Program.Start(String[] args)
Now when I look in the dependencies at the file monoPosix.netstandard.dll the dependencie mono.posix is showing a yellow warning flag.
SO It looks like my issue is in the dependencie of some dependencies...
I am a bit lost with the way I should fix this. So if anyone knows anything about installers with complex dependencies I would be glad to here from him.
Thank you in advance.
Alexandre Larribau

How to solve .Net Framework Version Issue?

It works fine on server. But now I'm deploying this on new server. I just copied the Package from my old server to this server.
When I browse application, getting the below mentioned error.
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
On new Server its showing .net clr version v4.0.30319, but on old server it is
.net version v4.0.30319 for Application Pool.
Is this Framework related Issue? or m I missing something?
You new server might not have an ASP.NET-MVC installed on. You can set the reference to System.Web.WebPages.Razor copied to local set to true.
Right click on the System.Web.WebPages.Razor in your references and click properties. Set the Copy Local to true.

Could not load file or assembly Exception from HRESULT: 0x80131040

I added PayPalMerchantSDK to my project through nuget. When I debug it it works perfectly but on live version I am getting exception that dll is not included.
The file or assembly 'PayPalMerchantSDK, Version = 2.14.117.0, Culture
= neutral, PublicKeyToken = 5b4afc1ccaef40fb "or one of its dependencies not found. The manifest definition found the assembly
does not match the assembly reference. (Exception from HRESULT:
0x80131040)
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for and
determine where the error originated in the code more information
about this error. Exception Details:
System.ServiceModel.FaultException`1
[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version =
4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089]]: The file or assembly 'PayPalMerchantSDK, Version = 2.14.117.0, Culture =
neutral, PublicKeyToken = 5b4afc1ccaef40fb "or one of its dependencies
not found. The manifest definition found the assembly does not match
the assembly reference. (Exception from HRESULT: 0x80131040)
I already checked:
dll is in bin folder
version, public key token are as required
I added "dependentAssembly" to config
I cleaned, rebuilded project deleted and added library through nuget several times
None of those helped. Any idea what else I can try?
One of the dependancies of PayPalMerchantSDK might be either missing or not the same version referenced from PayPalMerchantSDK.
You might depend on the some component that PayPalMerchantSDK depend on but your dependant versions might differ.

Problems upgrading MVC Mini Profiler to latest release

I've been using Mini Profiler in dev and production (azure) for a while and LOVE it.
It tried to upgrade to the latest release today via NUGET. The DLL get's placed in the bin but my site gets an error. If I go back to the old dll it works fine. Does anyone know how to fix this?
Server Error in '/' Application.
Could not load file or assembly 'MvcMiniProfiler, Version=2.0.4177.17902, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'MvcMiniProfiler, Version=2.0.4177.17902, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'MvcMiniProfiler, Version=2.0.4177.17902, Culture=neutral, PublicKeyToken=null' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileLoadException: Could not load file or assembly 'MvcMiniProfiler, Version=2.0.4177.17902, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
MyGlobal.application_BeginRequest(Object sender, EventArgs e) in C:\Users\Nate\Documents\Visual Studio 2010\Projects\TrainerRoad\com.TrainerRoad.DataAccess\MyGlobal.cs:15
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
Be sure to read the documentation on http://code.google.com/p/mvc-mini-profiler/
In particular:
Ensure you remove all the modifications you made to web.config.
If you are profiling Entity Framework grab the MiniProfiler.EF package
If you are running latest EF see: Problem using SQL Server CE with Entity Framework code-first and ASP.NET MVC 3 and mvc miniprofiler
There is not MiniProfiler version 2.0.4177.17902 so I really do not know where it is coming from.

log4net not logging and throwing error

I have been using log4Net to write in a text file when there is any exception in my web service, this was working but today it started to throw error.
System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.TypeInitializationException: The type
initializer for.. threw an exception.
---> System.IO.FileLoadException: Could not load file or assembly
'log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=b32731d11ce58905' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
File name: 'log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=b32731d11ce58905'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
If you have any inputs on this stack info, pls. share it.
Did you change the code, or did this just start happening?
I've seen this error occur when the target processor architecture was mismatched. Did you change that by any chance?
If this isn't the case, and you have Windows SDK installed, you can use the Fusion Log Viewer to view assembly binding logs. The utility should be installed on your machine.

Categories

Resources