Forms PCL project no longer builds

I have a couple of Xamarin forms projects where the PCL has stopped building with the error:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". 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.

I have checked out previous versions of the projects and they are failing similarly.
The only difference I am aware of is that one night Windows Update forced a restart and installed an update.

I am using Visual Studio 2015 and both projects are targetting .Net 4.5 one with profile 111 and the other with profile7.

The projects also fail to build with the same error using Xamarin studio.

How do I resolve the issue?

Best Answer

  • PatMoranPatMoran GBMember ✭✭
    Accepted Answer

    I resolved this issue by re-installing the OS and all the tools.

Answers

  • prashantvcprashantvc USXamarin Team Xamurai

    I’m unable to reproduce this issue using the latest Visual Studio 2015 stable version. Do you see this problem with new project too?

    Please attach the following to help us reproduce this issue:

    • Detailed reproduction steps
    • Version information (Help → About Microsoft Visual Studio → Copy Info)
    • Logs (Help → Xamarin → Zip Logs (last 7 days))
    • Optional: project to reproduce your issue
  • PatMoranPatMoran GBMember ✭✭

    I have attached one of the projects that are failing.

    The zip also has the Visual Studio info, and the logs zip.
    I have emptied the packages directory.

    to reproduce simply attempt to build the project.

  • prashantvcprashantvc USXamarin Team Xamurai

    @PatMoran
    Thanks for the details. Looks like the attached sample is missing linked files in the project.
    Could you share the full project?

  • PatMoranPatMoran GBMember ✭✭

    I have given you the complete project as far as I know.
    Can you tell me what files are missing.
    When I copy all the packages to the package directory and try to build I simply get the error

    There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". 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.

    So I cannot see what might be missing.

  • PatMoranPatMoran GBMember ✭✭

    I have just realized that there is at least one directory of source files missing.
    i have attached an updated zip file including the missing directory

  • Pxr87Pxr87 USMember

    I'm having the same issue, did you manage to resolve this?

  • FabioAngelaFabioAngela ITMember

    same here...

  • PatMoranPatMoran GBMember ✭✭
    Accepted Answer

    I resolved this issue by re-installing the OS and all the tools.

  • appieappie NLMember

    I resolved this by changing the targets to a different framework version (in my case from 4.5 to 4.5.1) That didn't succeed but the project file was changed to a different TargetFrameworkProfile: from Profile7 to Profile49. After that change the project was built succesfully!

Sign In or Register to comment.