Xamarin Xaml example problem using PCL

Hi, I'm gettting the following warnings that result in errors when I try to test out the XAML example following the websites directions:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(5,5): Warning MSB3270: 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. (MSB3270) (XAML)

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(5,5): Warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5,Profile=Profile78" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. (MSB3644) (XAML)

Im running Xamarin Trial on a Windows PC using Xamarin Studio.

Posts

  • mattwardmattward GBMember Xamurai

    Does the following directory exist on your machine?

    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78
    

    If not you will need to install the Portable Class Libraries. The simplest option is to install Visual Studio 2013 Express Update 2. If you do not want to install Visual Studio you can do the following:

    Install the Portable Class Library Tools using the /buildmachine command line argument.

    Install the Portable Class Libraries v4.6. If you install this it puts a .zip file into the directory:

     C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6
    

    You will need to unzip that and extract the contents into the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable directory. I would remove the folders from within this .NETPortable directory before copying the folders from the v4.6 zip file.

    Then finally reinstall Xamarin or repair the Xamarin install. That should add the Xamarin Portable Class Profiles.

  • How do i use the /buildmachine command line argument?

    I tried installing Portable Class Library Tools by running it but i get an error saying "Microsoft Visual Studio 2010 (with SP1) must be installed before installing Portable Library Tools 2 for Visual Studio 2010."

  • mattwardmattward GBMember Xamurai

    Open a command prompt and run:

     PortableLibraryTools.exe /buildmachine
    
  • Great! It works, thanks a lot!

  • vasussvasuss USMember

    Hi, i am also facing the similar issue, but unable to run 'PortableLibraryTools.exe /buildmachine' command through command prompt as getting error saying " 'PortableLibraryTools.exe' not recognized as internal or external command, operable program or batch file"
    i used windows command prompt.

    could you please let me know what is blocking to run this command?

    mine is windows operating system machine, VS 2010 installed

  • mattwardmattward GBMember Xamurai

    @vasuss - That error looks like you are running the command from a directory that does not contain the PortableLibraryTools.exe

  • vasussvasuss USMember

    Thanks Matt..

  • vasussvasuss USMember

    Hi Matt,

    i installed Portable Class Library Tools, Portable Class Libraries v4.6 ,
    placed unzip files into the .NETPortable Directory
    uni-install and installed Xamarin studio , but still same issue..
    Could you let me know how can i check whether Xamarin Portable Class Profiles added or not?

    Thanks,
    Vasu

  • mattwardmattward GBMember Xamurai

    @vasuss - What problem are you having? What error are you seeing?

  • vasussvasuss USMember

    Hi Matt, Please find below link for the error & to resolve this i followed the steps mentioned by you, but still same issue..

    https://forums.xamarin.com/discussion/comment/148228#Comment_148228

    Please help on this.

    Thanks,
    Vasu

  • mattwardmattward GBMember Xamurai

    @vasuss - The warnings in that other forum post are not related to PCLs.

    The first warning is about missing reference assemblies. You should be able to fix this on Windows by installing one of the Windows SDKs

    The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.
    

    The second warning is saying that your UITests project has a platform target of AnyCPU but the project being referenced has x86 as its platform target.

    Warning MSB3270: 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".
    

    I do not see this error when I create an Android project with an associated UITest project in Xamarin Studio on Windows. The Android project uses AnyCPU but it seems that it uses x86 for you. You should be able to fix that warning by changing the Android project to have the platform target of AnyCPU.

  • vasussvasuss USMember
    edited August 2015

    Hi Matt,
    Warning 1 : My system OS is windows 7 , the SDK for windows 7 doesn't contain the 4.5 version dlls.(Referred the 'Windows SDK' link provided by you), so i couldn't able to get the 4.5 version dlls. Could you let me know the alternative options?

    Warning 2 : Kindly let me know how to change the android project's platform target to AnyCPU?

    Thanks,
    Vasu

  • mattwardmattward GBMember Xamurai

    I would try installing a later version of the Windows SDK. I have many different versions installed on my Windows 7 machine including the Windows 8 SDK.

    To change the platform target, right click the project, select Options, select Compiler (in Build category), then there is a Platform target drop down list on the right hand side of the dialog.

  • MR Matt I have similar issues with targeting pack but i was able to solve that with your recommendations here, but afterwards i try running a program but i got this "unable to find message file 'cscui.dll' missing"

  • mattwardmattward GBMember Xamurai

    @adebayoabolaji - Not seen that error. A quick google search suggests something is broken on your machine. Maybe MSBuild.

  • Thanks @mattward

    The below worked. Just got this issue after updating to VS2015 Update 2.

    @mattward said:

    Does the following directory exist on your machine?

    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78
    

    If not you will need to install the Portable Class Libraries. The simplest option is to install Visual Studio 2013 Express Update 2. If you do not want to install Visual Studio you can do the following:

    Install the Portable Class Library Tools using the /buildmachine command line argument.

    Install the Portable Class Libraries v4.6. If you install this it puts a .zip file into the directory:

     C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6
    

    You will need to unzip that and extract the contents into the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable directory. I would remove the folders from within this .NETPortable directory before copying the folders from the v4.6 zip file.

    Then finally reinstall Xamarin or repair the Xamarin install. That should add the Xamarin Portable Class Profiles.

  • AlisonFernandesAlisonFernandes USMember ✭✭

    @MichaelRibbons.8567 said:
    Thanks @mattward

    The below worked. Just got this issue after updating to VS2015 Update 2.

    @mattward said:

    Does the following directory exist on your machine?

    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78
    

    If not you will need to install the Portable Class Libraries. The simplest option is to install Visual Studio 2013 Express Update 2. If you do not want to install Visual Studio you can do the following:

    Install the Portable Class Library Tools using the /buildmachine command line argument.

    Install the Portable Class Libraries v4.6. If you install this it puts a .zip file into the directory:

     C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6
    

    You will need to unzip that and extract the contents into the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable directory. I would remove the folders from within this .NETPortable directory before copying the folders from the v4.6 zip file.

    Then finally reinstall Xamarin or repair the Xamarin install. That should add the Xamarin Portable Class Profiles.

    Same, happened after a bad VS2015 Update 2 install. Extracting Portable Class Libraries v4.6 into C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable solved it for me (but I didn't remove what I had there, since I had additional stuff there).

Sign In or Register to comment.