title: .net 4.8 project with netstandard2.0 references will not build via msbuild
body: <p>The solution builds fine in VS2019, but when msbuild on our build agents gets a hold of our solution its complaining about references to several of our dlls.<br />
  I've just added a reference to a NuGet package that brought in a netstandard 2.0 dependency, so that seems to be the problem.<br />
  I have noticed that if I go onto a build server and build the solution in VS FIRST....then the same msbuild command line will succeed afterwards.  So it does seem to be the case that in the normal build situation these netstandard dlls arent being built such that they can be included in the other project compilations.</p>
  <blockquote>
  <p>F:\Agents\MyAgent_work\18\s\src\WS_Reports.metaproj : warning MSB3268: The primary reference &quot;F:\Agents\MyAgent_work\18\b\My.Project\My.Project.dll&quot; could not be resolved because it has an indirect dependency on the framework assembly &quot;netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51&quot; which could not be resolved in the currently targeted framework. &quot;.NETFramework,Version=v4.8&quot;. To resolve this problem, either remove the reference &quot;F:\Agents\MyAgent_work\18\b\My.Project\My.Project.dll&quot; or retarget your application to a framework version which contains &quot;netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51&quot;.</p>
  </blockquote>
  <p>Here's the solution file's declaration of the project whose msbuild throws the error....can see the project reference to the dlls that show up in the error (example above).  Note that both this and the project I added my new netstandard2.0 packages to target framework v4.8</p>
  <pre><code>Project(&quot;{E24C65DC-7377-472B-9ABA-BC803B73C61A}&quot;) = &quot;WS.Reports&quot;, &quot;WebServices\WS.Reports\&quot;, &quot;{C47BAAE6-0708-4D43-83B8-92405B31A3E0}&quot;
      ProjectSection(WebsiteProperties) = preProject
          SccProjectName = &quot;SAK&quot;
          SccAuxPath = &quot;SAK&quot;
          SccLocalPath = &quot;SAK&quot;
          SccProvider = &quot;SAK&quot;
          TargetFrameworkMoniker = &quot;.NETFramework,Version%3Dv4.8&quot;
          ProjectReferences = &quot;{2222173A-112A-44F8-A614-C7CCBDACEFE8}|My.Project.Bus.dll;{222924FE-877B-4E18-B960-94DED3DB6DF2}|MyProject.Protocols.Shared.dll;{222F5846-55E6-4541-B43B-E49674963E02}|MyProject.AuthProtocols.dll;{2224BC03-6C7E-4E15-B158-D9BD03D0E8B3}|My.Project.dll;{222BAF47-1C9F-4A56-9152-B4240A188612}|My.Project.Images.dll;{222FE788-27B1-4B03-B052-BCFFF251C15A}|My.Project.Legacy.dll;&quot;
          Debug.AspNetCompiler.VirtualPath = &quot;/WS.Reports&quot;
          Debug.AspNetCompiler.PhysicalPath = &quot;WebServices\WS.Reports\&quot;
          Debug.AspNetCompiler.TargetPath = &quot;PrecompiledWeb\WS.Reports\&quot;
          Debug.AspNetCompiler.Updateable = &quot;true&quot;
          Debug.AspNetCompiler.ForceOverwrite = &quot;true&quot;
          Debug.AspNetCompiler.FixedNames = &quot;false&quot;
          Debug.AspNetCompiler.Debug = &quot;True&quot;
          Release.AspNetCompiler.VirtualPath = &quot;/WS.Reports&quot;
          Release.AspNetCompiler.PhysicalPath = &quot;WebServices\WS.Reports\&quot;
          Release.AspNetCompiler.TargetPath = &quot;PrecompiledWeb\WS.Reports\&quot;
          Release.AspNetCompiler.Updateable = &quot;true&quot;
          Release.AspNetCompiler.ForceOverwrite = &quot;true&quot;
          Release.AspNetCompiler.FixedNames = &quot;false&quot;
          Release.AspNetCompiler.Debug = &quot;False&quot;
          VWDPort = &quot;17515&quot;
          VWDDynamicPort = &quot;false&quot;
          SlnRelativePath = &quot;WebServices\WS.Reports\&quot;
          StartServerOnDebug = &quot;false&quot;
      EndProjectSection
  EndProject
  </code></pre>
  <p>Perhaps I need the project throwing the errors OR the project(s) with the netstandard references to target both v4.8 and netstandard2.0?</p>