问题
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