2017-07-05 5 views
2

を入力するタイプ「可能System.String」のオブジェクトをキャストすることができませんVSTSにNugetパッケージをパックすることができません...「パック」を、私は次のエラーを取得しています実行するには「NuGet.Frameworks.NuGetFramework」

2017-07-05T10:37:09.7762333Z ##[section]Starting: NuGet pack 
2017-07-05T10:37:09.7762333Z ============================================================================== 
2017-07-05T10:37:09.7762333Z Task   : NuGet 
2017-07-05T10:37:09.7762333Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. 
2017-07-05T10:37:09.7762333Z Version  : 2.0.3 
2017-07-05T10:37:09.7762333Z Author  : Microsoft Corporation 
2017-07-05T10:37:09.7762333Z Help   : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747) 
2017-07-05T10:37:09.7762333Z ============================================================================== 
2017-07-05T10:37:10.9664575Z Downloading: https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe 
2017-07-05T10:37:11.0954621Z Caching tool: NuGet 4.0.0 x64 
2017-07-05T10:37:11.1084622Z Using version: 4.0.0 
2017-07-05T10:37:11.1094622Z Found tool in cache: NuGet 4.0.0 x64 
2017-07-05T10:37:11.1214629Z [command]C:\Windows\system32\chcp.com 65001 
2017-07-05T10:37:11.1634626Z Active code page: 65001 
2017-07-05T10:37:11.2234637Z Attempting to pack file: d:\a\1\s\src\Esoterix\Esoterix.csproj 
2017-07-05T10:37:11.2294640Z [command]d:\a\_tool\NuGet\4.0.0\x64\nuget.exe pack d:\a\1\s\src\Esoterix\Esoterix.csproj -NonInteractive -OutputDirectory d:\a\1\a -Properties Configuration=release -version 1.0.0-CI-201765-103711 -Verbosity Detailed 
2017-07-05T10:37:12.3087180Z NuGet Version: 4.0.0.2283 
2017-07-05T10:37:12.3187144Z Attempting to build package from 'Esoterix.csproj'. 
2017-07-05T10:37:12.7569409Z MSBuild auto-detection: using msbuild version '15.1.1012.6693' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild. 
2017-07-05T10:37:15.3118046Z Packing files from 'd:\a\1\s\src\Esoterix\bin\release\netcoreapp1.1'. 
2017-07-05T10:37:15.7119285Z Add file 'd:\a\1\s\src\Esoterix\bin\release\netcoreapp1.1\Esoterix.dll' to package as 'lib\netcoreapp1.1\Esoterix.dll' 
2017-07-05T10:37:15.7959331Z System.InvalidCastException: Unable to cast object of type 'System.String' to type 'NuGet.Frameworks.NuGetFramework'. 
2017-07-05T10:37:15.7969309Z at NuGet.ProjectManagement.NuGetProject.GetMetadata[T](String key) 
2017-07-05T10:37:15.7969309Z at NuGet.ProjectManagement.PackagesConfigNuGetProject..ctor(String folderPath, Dictionary`2 metadata) 
2017-07-05T10:37:15.7969309Z at CallSite.Target(Closure , CallSite , Type , Object , Dictionary`2) 
2017-07-05T10:37:15.7969309Z at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies) 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder) 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder) 
2017-07-05T10:37:15.7969309Z at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path) 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.PackCommand.ExecuteCommand() 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.Command.ExecuteCommandAsync() 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.Command.Execute() 
2017-07-05T10:37:15.7969309Z at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args) 
2017-07-05T10:37:15.8259323Z ##[error]Error: d:\a\_tool\NuGet\4.0.0\x64\nuget.exe failed with return code: 1 
2017-07-05T10:37:15.8259323Z ##[error]An error ocurred while trying to pack the files. 
2017-07-05T10:37:15.8289336Z ##[section]Finishing: NuGet pack 

この時点までにすべてがうまく拾われていると思われますので、ちょっと立ち往生しています。あらゆるアイデアを歓迎します

+0

の構成方法であるあなたが使用していますか?プロジェクトをVS2015からVS2017に移行しましたか?プロジェクトを1つのドライブにアップロードできますか? –

答えて

9

VSTSでは、「ナゲットパック」の代わりに「ドットネットパック」を使用しました。この問題は解決されました。 VSTSにnugetのlibを公開する

は、私は以下のプラグイン・シーケンスをchoiced:

  • はソース
  • DOTNETパック
  • を構築
  • DOTNETを復元nugetゲット
を押しnuget
+0

"nuget push"の代わりに "dotnet push"を使う必要があると思います –

0

これは、VSTSに組み込まれているNugetパックアイテムを使用した場合の問題です。代わりにdotnet packを呼び出すコマンドライン要素のためにそれをスワップし、今すぐ動作します。

1

私はこの問題は、私の.net標準2.0クラスl私はナゲットパッケージに入っていました。ここでは、nuget pack stepを置き換えるために追加する必要があるステップのスクリーンショットを示します。ここで Step Type To Add

を追加する

ステップタイプは、私は、エージェントは何段階に Here is how I configured the step

関連する問題