I have a solution that contains projects targeting .NET Framework 4.6.1 and a single project targeting .NET Core 2.0. This .Net Core project has references to projects targeting .NET Framework 4.6.1.
Locally, using Visual Studio 2017 Community, I can build this solution without any issue.
I am trying to configure a TeamCity build using the following steps :
1 - Clean packages folder
2 - Get packages : runner type = NuGet Installer and Restore mode = Restore
3 - Restore : dotnet restore MyDonetCoreProject.csproj
4 - Build solution : runner type = Visual Studio (sln) with VS 2017
I get a compilation error when compiling my .NET Core project :
C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198, 5): Package Microsoft.AspNetCore, version 2.0.3 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
I checked the path C:\Users\MyUser\.nuget\packages\microsoft.aspnetcore
on my TeamCity server and I have a folder 2.0.3
.
I don't have any reference in my solution to this package. What is looking to this package and where is it looking ?
dotnet build
so I had to stick to MSBuild. I will post my solution here. – rotman