Project file is changed due to project reference re-order

We are developing an iOS and Android application and we use both Xamarin Studio on the Mac and Visual Studio with Xamarin plugin on Windows.

The Android project references the new Google Play Services component. When you view the project in the respective solution explorer, the project reference orders are different:

On Mac, the project reference order is: GooglePlayServicesLib, Xamarin.Mobile.dll, Mono.Android, System
On Windows, the project reference order is: GooglePlayServicesLib, Mono.Android, System, Xamarin.Mobile.dll (alphabetical order)

I believe the reason the project file is marked as changed is because the respective platform is changing the project reference order each time the solution is open. Any ideas?

Thanks.

Glenn

Posts

  • mhutchmhutch USXamarin Team Xamurai

    Can you identify which IDE is changing it? I.e. what is the order of the references in source control?

  • GlennMillerGlennMiller USMember
    + code that was added
    - code that was removed
    
    Add Google Play Services component on mac through Xamarin Studio but open project on windows Visual Studio:
    
     <ItemGroup>
    +    <Reference Include="GooglePlayServicesLib">
    +      <HintPath>..\Components\googleplayservices10-10.0\lib\android\GooglePlayServicesLib.dll</HintPath>
    +    </Reference>
        <Reference Include="Mono.Android" />
        <Reference Include="System" />
        <Reference Include="System.Core" />
        <Reference Include="System.Xml" />
        <Reference Include="Xamarin.Mobile">
          <HintPath>..\packages\Xamarin-Mobile\MonoDroid\Xamarin.Mobile.dll</HintPath>
        </Reference>
    -    <Reference Include="GooglePlayServicesLib">
    -      <HintPath>..\Components\googleplayservices10-10.0\lib\android\GooglePlayServicesLib.dll</HintPath>
    -    </Reference>
      </ItemGroup>
      <ItemGroup>
    
    
      <ItemGroup>
        <XamarinComponentReference Include="googleplayservices10">
    -      <InstallationInProgress>False</InstallationInProgress>
          <Version>10.0</Version>
          <Visible>False</Visible>
        </XamarinComponentReference>
      </ItemGroup>
    
    Add Google Play Services component on windows through Visual Studio but open project on mac Xamarin Studio:
    
       <ItemGroup>
    -    <Reference Include="GooglePlayServicesLib">
    -      <HintPath>..\Components\googleplayservices10-10.0\lib\android\GooglePlayServicesLib.dll</HintPath>
    -    </Reference>
         <Reference Include="Mono.Android" />
         <Reference Include="System" />
         <Reference Include="System.Core" />
         <Reference Include="System.Xml" />
         <Reference Include="Xamarin.Mobile">
           <HintPath>..\packages\Xamarin-Mobile\MonoDroid\Xamarin.Mobile.dll</HintPath>
         </Reference>
    +    <Reference Include="GooglePlayServicesLib">
    +      <HintPath>..\Components\googleplayservices10-10.0\lib\android\GooglePlayServicesLib.dll</HintPath>
    +    </Reference>
       </ItemGroup>
    
      <ItemGroup>
        <XamarinComponentReference Include="googleplayservices10">
    +      <InstallationInProgress>False</InstallationInProgress>
          <Version>10.0</Version>
          <Visible>False</Visible>
        </XamarinComponentReference>
      </ItemGroup>
    
  • mhutchmhutch USXamarin Team Xamurai

    Thanks, I've identified the problem and fixed it.

    In future, please file bugs in our bug tracker.

  • ShaneMunnShaneMunn AUBeta ✭✭

    @mhutch, which bug # is this so that I can track it?

    We're having what appears to be the same issue with XS (Mac, 4.0.12 build 3) - we're both running the same build, both on mac but references to components are changing between the 2 of us - my instance puts them in one order, the other guy's instance of XS puts them in another order. Consequently we're continually getting merge conflicts unless we remember to discard the changes (unless we have both added files to the project).

    Cheers

  • mhutchmhutch USXamarin Team Xamurai

    I didn't actually open a bug for this, sorry. The fix should be in the next Xamarin Studio release.

  • GlennMillerGlennMiller USMember

    Thanks for your help!

Sign In or Register to comment.