Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 异常信息:System.IO.FileLoadException在生产环境中运行exe时发生异常_C#_.net_Dependency Injection_Console Application_Octopus Deploy - Fatal编程技术网

C# 异常信息:System.IO.FileLoadException在生产环境中运行exe时发生异常

C# 异常信息:System.IO.FileLoadException在生产环境中运行exe时发生异常,c#,.net,dependency-injection,console-application,octopus-deploy,C#,.net,Dependency Injection,Console Application,Octopus Deploy,我在.net framework 4.5中创建了一个导入控制台应用程序。 以下是我在应用程序中使用的软件包: <packages> <package id="CSVReader" version="3.8.1" targetFramework="net40" /> <package id="EnterpriseLibrary.Common" version="6.0.1304.0" targetFramework="net45" /> <pa

我在.net framework 4.5中创建了一个导入控制台应用程序。 以下是我在应用程序中使用的软件包:

<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>
有人知道这个错误的可能原因吗?
提前谢谢

尝试将目标CPU设为x86

能否显示处理任何文件的代码?检查权限?查看本地bin文件夹中的所有文件(尤其是exe和dll)。将其与生产机器上的所有文件进行比较。本地计算机上是否有生产计算机上缺少的任何内容?服务器上是否安装了.NET 4.5?您能发布启动时运行的代码吗?
据我所知
-所以您并列列出了这些文件,它们都是相同的?完全一样?这是评论,不是回答。
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()