title: project.assets.json not found with msbuild
body: <p>I have an ASP.NET Core application that i wish to build on a jenkins machine with MSBuild 15.</p>
  
  <p>When i try to build i get the following error:</p>
  
  <blockquote>
    <p>C:\Program Files\dotnet\sdk\2.1.502\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,
    5): error NETSDK1004: Assets file 'C:\sync\Src\Util\myUtil\ob
    j\project.assets.json' not found. Run a NuGet package restore to generate this file</p>
  </blockquote>
  
  <p>I understand that i need to do nuget restore somehow, but i failed to make it work.</p>
  
  <p>My build process:
  Running a batch filed with the following command:</p>
  
  <pre><code>call "%VS150COMNTOOLS%VsDevCmd.bat"
  MSBuild DailyBuild.proj /t:DailyBuild /p:VersionNumber=%2 /l:FileLogger,Microsoft.Build.Engine;logfile=Build.log
  </code></pre>
  
  <p>The DailyBuild.proj file look like this:</p>
  
  <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup&gt;
      &lt;SourcesPath&gt;$(MSBuildProjectDirectory)\..\..\&lt;/SourcesPath&gt;
      &lt;CSCleanProperties&gt;BuildType=Clean;Configuration=Release;IsFormalBuild=true&lt;/CSCleanProperties&gt;
      &lt;CSBuildProperties&gt;BuildType=ReBuild;Configuration=Release;PauseBuildOnError=false;PublishWebSites=true;VersionName=myProd-$(VersionNumber)&lt;/CSBuildProperties&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;Target Name="DailyBuildWithClean"&gt;
      &lt;MSBuild Projects="$(MSBuildProjectDirectory)\Make.proj" Targets="Clean" Properties="$(CSCleanProperties)"/&gt;
      &lt;MSBuild Projects="$(MSBuildProjectDirectory)\Make.proj" Properties="$(CSCleanProperties)"/&gt;
      &lt;MSBuild Projects="$(MSBuildProjectDirectory)\Make.proj" Targets="FormalBuild" Properties="$(CSBuildProperties)"/&gt;
    &lt;/Target&gt;
  
    &lt;Target Name="DailyBuild"&gt;
      &lt;MSBuild Projects="$(MSBuildProjectDirectory)\Make.proj" Targets="SW;PreparePackFolder" Properties="$(CSBuildProperties)"/&gt;
    &lt;/Target&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>The Make.proj is a proj file containing definitions for many applications to be built, one of them is my ASP.NET Core app.</p>
  
  <p>How do i fix this problem? thank you.</p>
  
  <p>SOLUTION EDIT:
  Thanks to solution by Martin Ullrich:</p>
  
  <p>Added in the DailyBuild.proj the target Restore, also added in the Make.proj a target called restore as suggested 
  (IE:</p>
  
  <pre><code>&lt;Target Name="Restore"&gt;
    &lt;MSBuild Projects="$(SourcesPath)\my.sln" Targets="Restore" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>)</p>