title: VS2019 cannot load the project due to missing NuGet Microsoft.NET.Sdk.Functions package, but cannot add this package either
body: <p>One of the projects I have in my solution is not loading in VSE2019. It throws this error: </p>
  
  <pre><code>C:\MyProgram\src\MyProgram.Functions.csproj : error  : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.
  Detailed Information:
  Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
  </code></pre>
  
  <p>The project was created by another Dev (who is not here), and the .csproj contains the following:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;net472&lt;/TargetFramework&gt;
      &lt;AzureFunctionsVersion&gt;v1&lt;/AzureFunctionsVersion&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" /&gt;
      &lt;PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" /&gt;
      &lt;PackageReference Include="WindowsAzure.ServiceBus" Version="2.1.0" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Reference Include="Microsoft.CSharp" /&gt;
      &lt;Reference Include="Microsoft.ServiceBus"&gt;
        &lt;HintPath&gt;..\packages\WindowsAzure.ServiceBus.2.1.0.0\lib\net40-full\Microsoft.ServiceBus.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="System.Configuration" /&gt;
      &lt;Reference Include="System.Web" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;None Update="host.json"&gt;
        &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
      &lt;/None&gt;
      &lt;None Update="local.settings.json"&gt;
        &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
        &lt;CopyToPublishDirectory&gt;Never&lt;/CopyToPublishDirectory&gt;
      &lt;/None&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>Here are the following I have tried so far, but still with no positive results:</p>
  
  <ol>
  <li>I have commented out the line that refers to this package, and then reloaded the solution (even restarted VS2019):</li>
  </ol>
  
  <pre><code>&lt;!-- &lt;PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" /&gt; --&gt;
  </code></pre>
  
  <ol start="2">
  <li>I tried to install the missing NuGet package, but since the project has not been loaded - I cannot install it into this project (as this project simply is not available in the available projects list, when installing NuGet).</li>
  </ol>
  
  <p>I'm not sure why this project is getting so "stiky" to the package?
  Or how to force to install the missing NuGet to this project?</p>