title: Remove a package via script in xamarin forms
body: <p>I have a build build script(MyBuild.sh) set up for creating the Android apk for a xamarin forms application. </p>
  
  <p>My requirement is when i give the internal test builds i want the microsoft app center crashes and analytics in the the project csproj but when i take the PROD builds i don't want the microsoft app center crashes and analytics in the project</p>
  
  <p>so in the build script i check whether its a PROD build and tried to remove the app center packages from the csproj. </p>
  
  <pre><code>if [ $Env == 'PROD' ]
  then
      dotnet remove ./Sample/Sample.csproj package Microsoft.AppCenter.Analytics
      dotnet remove ./Droid/Sample.Droid.csproj package Microsoft.AppCenter.Crashes
  fi
  </code></pre>
  
  <p>My problem is when the script is executed it correctly removes the package from the Shared Code but not from the Droid.csproj and while trying to remove the package it throws </p>
  
  <pre><code>info : Removing PackageReference for package 'Microsoft.AppCenter.Crashes' from project './Droid/Sample.Droid.csproj'.
  error: The imported project "/usr/local/share/dotnet/sdk/2.1.4/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the &lt;Import&gt; declaration is correct, and that the file exists on disk.  /Users/george.thomas/Documents/Nov/Candidate/Droid/Sample.Droid.csproj
  </code></pre>
  
  <p>Now if i remove the MSBuildExtensionsPath from the Droid.csproj and run the script it correctly removes the packages but the project cant be built
  throwning <code>The target "Build" does not exist in the project</code></p>
  
  <pre><code>&lt;Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /&gt;
  </code></pre>