tag:help.appveyor.com,2012-11-13:/discussions/problems/14915-net-core-21-build-fails-after-adding-a-database-projectAppVeyor: Discussion 2018-10-19T08:18:49Ztag:help.appveyor.com,2012-11-13:Comment/456079002018-07-03T03:47:36Z2018-07-03T03:47:36Z.net core 2.1 build fails after adding a database project<div><p>Is <code>dotnet restore</code> works for you locally? And if yes, what .NET Core SDK is installed locally? It seems like issue described <a href="https://github.com/NuGet/Home/issues/6665">here</a>.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/456079002018-07-03T03:55:40Z2018-07-03T03:55:41Z.net core 2.1 build fails after adding a database project<div><p>Yes, it always works locally for me with .net core sdk v2.1.301.</p></div>Arash Sabettag:help.appveyor.com,2012-11-13:Comment/456079002018-07-03T11:38:30Z2018-07-03T11:38:31Z.net core 2.1 build fails after adding a database project<div><p>I think some changes/fixes should take place in your build servers like installing the new SDK, etc. I don't think if I can do much by altering the build definition.</p></div>Arash Sabettag:help.appveyor.com,2012-11-13:Comment/456079002018-07-04T00:54:20Z2018-07-04T00:54:20Z.net core 2.1 build fails after adding a database project<div><p>I see that you fixed that using <a href="https://stackoverflow.com/a/51157839/6733637">Martin's advise</a>. It never hurts to update the forum thread though so other people can benefit from it.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/456079002018-07-04T13:45:47Z2018-07-04T13:45:48Z.net core 2.1 build fails after adding a database project<div><p>Indeed. The fix took place by including the following two steps in the yml file:</p>
<p>msbuild /t:restore PathToTheSolutionFile<br>
msbuild /t:build PathToTheSolutionFile</p></div>Arash Sabettag:help.appveyor.com,2012-11-13:Comment/456079002018-07-04T17:19:12Z2018-07-04T17:19:12Z.net core 2.1 build fails after adding a database project<div><p>Thanks. However I do not think that <code>msbuild /t:build</code> is pessary. <code>msbuild /t:restore</code> can be called as <code>before_build</code> script, and then AppVeyor will execute correct build command automatically (provided <code>build_script</code> does not exist). This is useful if you for example need automatic <a href="https://www.appveyor.com/docs/build-phase/#packaging-net-core-nuget-libraries">nuget packaging</a>.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/456079002018-07-04T21:40:10Z2018-07-04T21:40:11Z.net core 2.1 build fails after adding a database project<div><p>Done! and it works.</p></div>Arash Sabet