Ignore “targeting 'xxx' is not compatible with the project's target” warning

[亡魂溺海] 提交于 2020-01-07 02:45:11

问题


I have created an installer for my project and I included a special .dll file that needs to be copied on the target machine. The compiler displays the following warning:

File '[filename]' targeting 'Unknown' is not compatible with the project's target platform 'x86'

I don't care about the target platform of that dll because I need the file for other purposes. Also, I need to leave this file "untouched" so I cannot change its target platform. So I need a way to ignore this warning. I tried to accomplish this using #pragma but I can't find the Warning Number for this warning. I tried to find it using the Output window (Build) and also using Show Error Help button with no luck though.

Any suggestions? Thanks!


回答1:


You can edit your project file and add this property group and setting to disable the warning:

<PropertyGroup>
    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>


来源:https://stackoverflow.com/questions/14954375/ignore-targeting-xxx-is-not-compatible-with-the-projects-target-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!