Dorel Gabor
Dorel Gabor

Reputation: 1

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

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!

Upvotes: 0

Views: 937

Answers (1)

David Brabant
David Brabant

Reputation: 43499

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

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

Upvotes: 1

Related Questions