tag:help.appveyor.com,2012-11-13:/discussions/problems/12928-build-failing-without-any-changeAppVeyor: Discussion 2018-10-19T08:18:42Ztag:help.appveyor.com,2012-11-13:Comment/448931562018-03-13T01:31:28Z2018-03-13T01:31:32ZBuild failing without any change<div><p>It seems like something changed on the virtual machine causing the build to fail without any change to the codebase.</p>
<p>The failing build: <a href="https://ci.appveyor.com/project/tzachshabtay/monoags/build/job/0pow9i63jjtti1kg">https://ci.appveyor.com/project/tzachshabtay/monoags/build/job/0pow...</a><br>
A successful build just 3 days ago for the same codebase: <a href="https://ci.appveyor.com/project/tzachshabtay/monoags/build/1.0.621/job/lc3qubmgk3ksv83s">https://ci.appveyor.com/project/tzachshabtay/monoags/build/1.0.621/...</a></p>
<p>Note that the error seen in the failed build also happens in the successful build, so it wasn't failing the build then but it is now?.</p>
<p>This is the error:<br>
C:\projects\monoags\Source\AGS.API\AGS.API.csproj(281,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v5.0\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.</p>
<p>The only difference seems to be that the successful build is running against dotnet 2.1.4 and not 2.1.100.</p></div>Tzach Shabtaytag:help.appveyor.com,2012-11-13:Comment/448931562018-03-13T01:49:40Z2018-03-13T01:49:40ZBuild failing without any change<div><p>What happens if you rebuild your successful build? For that you can open it and press <code>RE-BUILD COMMIT</code> button.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/448931562018-03-13T11:59:57Z2018-03-13T11:59:59ZBuild failing without any change<div><p>It fails the same way: <a href="https://ci.appveyor.com/project/tzachshabtay/monoags/build/job/wc7t84j7se43vgoa">https://ci.appveyor.com/project/tzachshabtay/monoags/build/job/wc7t...</a></p></div>Tzach Shabtaytag:help.appveyor.com,2012-11-13:Comment/448931562018-03-14T01:06:17Z2018-03-14T01:06:17ZBuild failing without any change<div><p>As a workaround, you can add a global.json file to the project with the following in it to force specific dotnet sdk,<br></p>
<pre>
<code>{
"sdk": {
"version": "2.1.4"
}
}</code>
</pre></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/448931562018-03-14T15:24:31Z2018-03-14T15:24:32ZBuild failing without any change<div><p>Thanks, the workaround works for now.</p></div>Tzach Shabtaytag:help.appveyor.com,2012-11-13:Comment/448931562018-03-14T18:23:20Z2018-03-14T18:23:20ZBuild failing without any change<div><p>Sorry, i misspoke. Its not really a workaround but rather the <a href="https://docs.microsoft.com/en-us/dotnet/core/tools/global-json">established way</a> to specify a version of .net core sdk.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/448931562018-05-03T18:29:14Z2018-05-03T18:29:14ZBuild failing without any change<div><p>Hi, this workaround is causing problems for our users. We don't want to tie down the tooling to a specific dot net core version.</p>
<p>I tried to remove it now, but I'm getting:<br>
C:\projects\monoags\Source\AGS.API\AGS.API.csproj(289,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.103\Microsoft\Portable\v5.0\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.</p>
<p>From:<br>
<a href="https://ci.appveyor.com/project/tzachshabtay/monoags/build/1.0.756/job/24avq7ejyjvpdj5t">https://ci.appveyor.com/project/tzachshabtay/monoags/build/1.0.756/...</a></p>
<p>Even though it works fine on multiple machines we tested on locally.</p>
<p>How can we resolve this?</p>
<p>Thanks.</p></div>Tzach Shabtaytag:help.appveyor.com,2012-11-13:Comment/448931562018-05-04T00:08:05Z2018-05-04T00:08:05ZBuild failing without any change<div><p>Following advice given <a href="https://developercommunity.visualstudio.com/content/problem/20550/cant-run-dotnet-restore.html">here</a> i tried changing <code>dotnet restore</code> to <code>msbuild /t:restore MonoAGS.sln</code> and that seemed to work.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/448931562018-05-04T16:34:18Z2018-05-04T16:34:18ZBuild failing without any change<div><p>Thanks, it works.</p></div>Tzach Shabtay