Es gibt eine Warnung nur oben ist der Fehler:
/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Configuration.Abstractions". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/home/travis/build/ovation22/DapperRepository/Example.Repository/Example.Repository.csproj]
DapperRepository.cs(7,17): error CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/travis/build/ovation22/DapperRepository/Example.Repository/Example.Repository.csproj]
DapperRepository.cs(16,33): error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?) [/home/travis/build/ovation22/DapperRepository/Example.Repository/Example.Repository.csproj]
Werfen wir einen Blick auf Example.Repository.csproj
nehmen:
<ItemGroup>
<PackageReference Include="Dapper" Version="1.50.2" />
</ItemGroup>
Das sieht gut aus. Aber wo ist Microsoft.Extensions.Configuration.Abstractions
? Schauen wir uns ein wenig tiefer:
<Reference Include="Microsoft.Extensions.Configuration.Abstractions">
<HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.configuration.abstractions\2.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference>
So msbuild Sie sagen, dass es bei C:\Program Files
zur Verfügung steht. Travis führt das unter Linux aus, wo dieser Pfad offensichtlich nicht existiert.
Versuchen Sie eine PackageReference
wie Dapper
in diesem csproj. Das sollte das beheben.
Nun * kurz vor * diesem Fehler, erhalten Sie: '/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): Warnung MSB3245: Konnte diesen Verweis nicht auflösen. Konnte die Assembly "Microsoft.Extensions.Configuration.Abstractions" nicht finden. "Ich würde mich wundern, wenn das nicht verwandt wäre. –
(Es ist seltsam, dass der Dotnet-Wiederherstellungsschritt erwähnt Microsoft.Extensions.Configuration.Abstractions sowohl für v1.0.0 als auch v2.0.0.) –