title: C# MVC deployed to Azure started asking for unused assemblies
body: <p>I have a C# MVC SharePoint provider hosted add-in that i created a while ago. I thought about giving it a bit of extra security using AAD Authentication.</p>
  
  <p>I used the VS 2017 Connected Services to install everything related to AAD Auth without manually adding them. I didnt even get to the part where i test my auth because if i deploy to Azure it throws an error.</p>
  
  <blockquote>
    <p>Could not load file or assembly 'Microsoft.SharePoint.Library, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.</p>
  </blockquote>
  
  <p>I tried adding it manually, no luck. Localhost works fine, azure hosted doesnt.</p>
  
  <p>This is a weird problem since:</p>
  
  <ol>
  <li>My app was working perfectly before adding AAD Auth.</li>
  <li>I never use the assemblies it asks for (it asked for <code>Microsoft.Sharepoint.ServerRuntime</code>, but adding that manually worked).</li>
  </ol>
  
  <p>Before i start trying to add AAD auth manually i thought about asking here, perhaps you guys have any idea.</p>
  
  <p>P.S: I cant modify the reference <code>Copy Local</code> to <code>True</code>. Its a disabled property that cant be modified and set as <code>False</code> on default.</p>
  
  <p>UPDATE: Just re-tested with a copy i had (i made a copy before adding the auto AAD auth) and its exactly as i thought. Before adding AAD Auth it didnt ask for any assembly (no errors), nor does it use the assemblies it keeps saying are missing (tested it on local and azure, without AAD works 100% fine).</p>
  
  <p>UPDATE2: Narrowed it down even further by trying to manually install AAD Auth. The errors with missing assemblies (unused ones) start showing up when i install this package - <code>Install-Package Microsoft.Owin.Host.SystemWeb</code></p>