2017-09-08 20 views
3

Travis-CIにまだありません。 Travis-CIでビルドエラーが発生しましたが、ローカルではありません。Travis-CIのビルドに失敗しました "型名または名前空間の名前 'Extensions'がネームスペースに存在しません"

サンプル.NET Core 2.0アプリ。私は次のエラーを受け取るビルドを通って行く:

error CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?)

はここで設定し、ジョブログへのリンクです:警告は、ちょうど上記

https://travis-ci.org/ovation22/DapperRepository/jobs/273068340

+2

まあ*そのエラーの直前に、あなたは '/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5):警告MSB3245:この参照を解決できませんでした。アセンブリ "Microsoft.Extensions.Configuration.Abstractions"を見つけることができませんでした。 "それが関連していない場合、私は驚くでしょう。 –

+0

(ドットネットのリストア手順では、Microsoft.Extensions.Configuration.Abstractionsがv1.0.0とv2.0.0の両方で記述されています。 –

答えて

3

ありエラー:

/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]

0123正常に見える

<ItemGroup> 
    <PackageReference Include="Dapper" Version="1.50.2" /> 
</ItemGroup> 

を:

Example.Repository.csprojを見てみましょう。しかし、Microsoft.Extensions.Configuration.Abstractionsはどこですか?

<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> 

だから、あなたはそれがC:\Program Filesで利用可能であることのMSBuildを言っている:少し低く見てみましょう。 Travisは、このパスが明らかに存在しないLinuxでこれを実行しています。

そのcsprojにのようにPackageReferenceを追加してみてください。それはこれを解決するはずです。

+0

Doh、私は愚かな気がします。私はalt-enter Rを幸せにしたに違いない。それがトリックでした。ありがとう! – ovation22

関連する問題