C#windows应用程序 [英] C# windows application

查看:98
本文介绍了C#windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Error	5	File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'	E:\JavedBakup\Qlait30Dec2016\QlaitV1.9\QlaitV1.9.vdproj	QlaitV1.9





我的尝试:



设置相关问题









What I have tried:

Setup Related Question



<pre>Error	5	File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'	E:\JavedBakup\Qlait30Dec2016\QlaitV1.9\QlaitV1.9.vdproj	QlaitV1.9

推荐答案

当您为X86构建应用程序时,您正在为32位环境构建它 - 而您可以在64位运行32位应用程序环境,你不能混合 - 匹配这两个。

你引用的Log4Net程序集是64位文件:它是为x64而不是x86而构建的 - 你不能从32位应用程序访问64位代码,因为所有e支持代码(例如内存分配系统)全部为原始32位应用程序加载。



您可以更改程序集属性以为x64构建它: br />
在VS中打开您的解决方案。

打开解决方案资源管理器窗格

打开项目分支,然后双击属性。 />
在出现的页面中,选择左侧的Build选项卡,将Platform target更改为x64。



保存页面,并重建你的应用程序。
When you build an application for X86 you are building it for a 32bit environment - and while you can run a 32 bit app in a 64 bit environment, you can't "mix-n-match" the two.
The Log4Net assembly you are referencing is a 64 bit file: it was built for x64 instead of x86 - and you can't access 64 bit code from a 32 bit app because all the support code (the memory allocation system for example) is all loaded for the original 32 bit application.

You can change your Assembly properties to build it for x64:
Open your solution in VS.
Open the Solution Explorer pane
Open the project branch, and then double click on "Properties".
In the page that appears, select the "Build" tab on the left, and change "Platform target" to "x64".

Save the page, and rebuild your app.


你有一个log4net项目,它被构建为64位.DLL。您不能在32位项目(x86)中使用该库。



获取32位版本的log4net或将项目属性更改为目标64位(64)。请注意,仅定位64位不允许您的代码在32位Windows上运行。
You've got a log4net project that's being built as a 64-bit .DLL. You cannot use that library in a 32-bit project (x86).

Either get the 32-bit version of log4net or change your project properties to target 64-bit (x64). Keep in mind that targeting 64-bit only will not allow your code to run on 32-bit Windows.


这篇关于C#windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆