Tuesday, November 13, 2012

Microsoft.Common.targets Warning/ Error: 1578 There was a mismatch between the processor architecture of the project being built...

We get this sort of errors most probably while using MS Build to deploy project from a development environment to production environment by implementing Continuous Integration Build, etc approach.

The exact error message would look like:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1578): There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "<<Assembly Name>>", "AMD64". 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 

As such if you intend to deploy your application over x86 platform, then this warning message is just a warning, nothing else, and will not harm execution of your application in any way.

However, perform following steps in order to get rid of this warning:

1) Open project file (.csproj) using some text editor (like, Notepad, Notepad++, etc)
2) Add following in <PropertyGroup> section of the project file.

<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

3) Save changes done to .csproj file.
4) Do the same for all project files within your solution.

Now try build using MS Build, and you will not get those warning messages.


No comments:

Post a Comment

Thanks for visiting my blog.
However, if this helped you in any way, please take a moment to write a comment.

Thanks
Nirman