Exception Info: System.IO.FileLoadException when running exe on production

0

I have created one import console application in .net framework 4.5 . These are the packages that I have used in my application :

<packages>
  <package id="CSVReader" version="3.8.1" targetFramework="net40" />
  <package id="EnterpriseLibrary.Common" version="6.0.1304.0" targetFramework="net45" />
  <package id="EnterpriseLibrary.Data" version="6.0.1304.0" targetFramework="net45" />
  <package id="log4net" version="2.0.0" targetFramework="net40" />
  <package id="OctoPack" version="2.0.18" targetFramework="net40" />
</packages>

The console application is working absolutely fine on my local system but when I try to deploy it on server and run the exe it is throwing me this error:

Faulting application name: app.exe, version: 1.0.0.0, time stamp: 0x58f0c4a0
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23796, time stamp: 0x59029714
Exception code: 0xe0434352
Fault offset: 0x000000000001a06d
Faulting process id: 0x258
Faulting application start time: 0x01d2df846c72d791
Faulting application path: D:\filePath\app.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll

Application: app.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
   at System.ModuleHandle.ResolveType(System.Reflection.RuntimeModule, Int32, IntPtr*, Int32, IntPtr*, Int32, System.Runtime.CompilerServices.ObjectHandleOnStack)
   at System.ModuleHandle.ResolveTypeHandleInternal(System.Reflection.RuntimeModule, Int32, System.RuntimeTypeHandle[], System.RuntimeTypeHandle[])
   at System.Reflection.RuntimeModule.ResolveType(Int32, System.Type[], System.Type[])
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(System.Reflection.CustomAttributeRecord, System.Reflection.MetadataImport, System.Reflection.Assembly ByRef, System.Reflection.RuntimeModule, System.Reflection.MetadataToken, System.RuntimeType, Boolean, System.Object[], System.Collections.IList, System.RuntimeType ByRef, System.IRuntimeMethodInfo ByRef, Boolean ByRef, Boolean ByRef)
   at System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeModule, Int32, Int32, System.RuntimeType, Boolean, System.Collections.IList, Boolean)
   at System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeAssembly, System.RuntimeType)
   at System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, Boolean)
   at System.AppDomain.GetTargetFrameworkName()

Does anyone knows what could be the possible reason for this error? Thanks in advance .

c#
.net
dependency-injection
console-application
octopus-deploy
asked on Stack Overflow Jun 12, 2017 by Prateek Gupta

1 Answer

-1

Try making the target CPU to x86

answered on Stack Overflow Jun 13, 2017 by Niel Gomez

User contributions licensed under CC BY-SA 3.0