msbuild を使用して csproj プロジェクトをビルドしようとしていますが、nuget.targets が見つからないという不平を言う、あらゆる種類の奇妙な問題があります。
MSbuild で最も単純なコマンド ライン ビルドを実行します。
Msbuild Project.csproj
そして、それは通常の dev フォルダーでは機能しますが、別のフォルダーの場所では、次のエラーで失敗します。
error MSB4019: The imported project "C:\BuildAgent\work\CableSense\.nuget\nuget.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
そのパス ( C:\BuildAgent\work\CableSense\.nuget\nuget.targets
) は実際には間違っており、作業後のフォルダー (work\somefolder\cablesense) がありませんが、その理由がわかりません。さらに奇妙なことに、ソリューションの一部である別のプロジェクトをビルドすると、それは機能します。それはこのプロジェクトだけです。
csproj は、nuget.targets ファイルの場所を次のように指定します。
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
SolutionDir は次のように定義されます。
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
これは、機能する他のプロジェクトと同じです。何か案は?