Pokud máte stejně jako já rádi čisté okno Error List ve Visual Studiu, pak vás může otravovat warrning typu
There was a mismatch between the processor architecture of the project being built „MSIL“ and the processor architecture of the reference „XYZ, Version=XXX, Culture=neutral, processorArchitecture=x86“, „XXX“. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Nechci teď rozebírat, jak vyřešit příčinu hlášky, ale mám návod, jak se vypořádat se situací, kdy se příčiny zbavit nechcete/nemůžete, ale potřebujete hlášku potlačit (suppress).
Do .csproj
souboru příslušného projektu stačí do úvodní sekce PropertyGroup
přidat:
<PropertyGroup> <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch> </PropertyGroup>
Jenom pozor, že tím můžete zakrýt i další varování, která se objeví později a mohou vás zajímat.