2017-08-12 5 views
1

私は数時間を費やしてこれを理解しようとしましたが、単純にできませんでした。 FWIWでは、このプロジェクトはローカルコマンドラインとTeamCityからうまくいっています。 VSTS上にも構築されていますが、このエラーによってタスクが失敗します。 visualstudio.comビルドで探しているNugetパックのタスクは、どのような環境変数ですか?VSTS:## [エラー]提供された環境変数の値が見つかりませんでした

package.nuspec:

<?xml version="1.0"?> 
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> 
    <metadata> 
    <id>VDS.AppCore.Formatters</id> 
    <version>$version$</version> 
    <title>VDS AppCore Formatters</title> 
    <authors>Visual Data Solutions, Inc.</authors> 
    <owners>Visual Data Solutions, Inc.</owners> 
    <requireLicenseAcceptance>false</requireLicenseAcceptance> 
    <description>VDS AppCore Formatters</description> 
    <copyright>Copyright © Visual Data Solutions, Inc. 2010-2017</copyright> 
    </metadata> 
    <files> 
    <file src="$SolutionDir$VDS.AppCore.Formatters\bin\$Configuration$\VDS.AppCore.Formatters.dll" target="lib\net45" /> 
    <file src="$SolutionDir$VDS.AppCore.Formatters\bin\$Configuration$\VDS.AppCore.Formatters.pdb" target="lib\net45" /> 
    <file src="$SolutionDir$VDS.AppCore.Formatters\**\*.cs" target="src" /> 
    </files> 
</package> 

.csproj

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProjectGuid>{BED8C9D5-954F-47AA-9BDA-531D125209C0}</ProjectGuid> 
    <OutputType>Library</OutputType> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>VDS.AppCore.Formatters</RootNamespace> 
    <AssemblyName>VDS.AppCore.Formatters</AssemblyName> 
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 
    <FileAlignment>512</FileAlignment> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <ItemGroup> 
    <Reference Include="System" /> 
    <Reference Include="System.Core" /> 
    <Reference Include="System.Xml.Linq" /> 
    <Reference Include="System.Data.DataSetExtensions" /> 
    <Reference Include="Microsoft.CSharp" /> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Net.Http" /> 
    <Reference Include="System.Xml" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="CsvFormatter.cs" /> 
    <Compile Include="DataFormatters.cs" /> 
    <Compile Include="DefaultFormatters.cs" /> 
    <Compile Include="Formatters.cs" /> 
    <Compile Include="IDataFormatter.cs" /> 
    <Compile Include="IDataFormatters.cs" /> 
    <Compile Include="IFlatFormatter.cs" /> 
    <Compile Include="IFormatters.cs" /> 
    <Compile Include="Properties\AssemblyInfo.cs" /> 
    <Compile Include="XlsFormatter.cs" /> 
    </ItemGroup> 
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 
</Project> 

Task Configuration:

任意の入力が認識されるであろう。ここ

は、関連するファイルやタスクの設定です。これは私を苦労させています。私たちの現在の要件であるクラウド上のvstsにTeamCity上のTeamCityからビルドプロセスを移動させないようにしています。私は本当にTeamCity VMを作成したくありません。 :)コメント要求あたり

ビルドログ:それはNuGetパックのタスクで環境変数オプションによって引き起こさ

2017-08-16T03:14:26.4967581Z ##[section]Starting: NuGet pack Formatters nuspec 
2017-08-16T03:14:26.4967581Z ============================================================================== 
2017-08-16T03:14:26.4967581Z Task   : NuGet 
2017-08-16T03:14:26.4967581Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. 
2017-08-16T03:14:26.4967581Z Version  : 2.0.6 
2017-08-16T03:14:26.4967581Z Author  : Microsoft Corporation 
2017-08-16T03:14:26.4967581Z Help   : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747) 
2017-08-16T03:14:26.4977585Z ============================================================================== 
2017-08-16T03:14:26.9697601Z [command]C:\Windows\system32\chcp.com 65001 
2017-08-16T03:14:26.9787594Z Active code page: 65001 
2017-08-16T03:14:26.9917604Z Attempting to pack file: d:\a\1\s\TeamCity\Build\VDS.AppCore.Formatters\Package.nuspec 
2017-08-16T03:14:26.9967613Z [command]d:\a\_tool\NuGet\4.0.0\x64\nuget.exe pack d:\a\1\s\TeamCity\Build\VDS.AppCore.Formatters\Package.nuspec -NonInteractive -OutputDirectory d:\a\1\a -Properties Configuration=Debug;SolutionDir=d:\a\1\s\;ArtifactDir=d:\a\1\a;version=2.0.1.71;Platform=AnyCPU -version 2.0.1.71 -Verbosity Detailed 
2017-08-16T03:14:27.4699931Z NuGet Version: 4.0.0.2283 
2017-08-16T03:14:27.4777604Z Attempting to build package from 'Package.nuspec'. 
2017-08-16T03:14:27.6887611Z 
2017-08-16T03:14:27.6907601Z Id: VDS.AppCore.Formatters 
2017-08-16T03:14:27.6907601Z Version: 2.0.1.71 
2017-08-16T03:14:27.6907601Z Authors: Visual Data Solutions, Inc. 
2017-08-16T03:14:27.6907601Z Description: VDS AppCore Formatters 
2017-08-16T03:14:27.6907601Z Dependencies: None 
2017-08-16T03:14:27.6907601Z 
2017-08-16T03:14:27.6937601Z Added file '[Content_Types].xml'. 
2017-08-16T03:14:27.6937601Z Added file '_rels/.rels'. 
2017-08-16T03:14:27.6937601Z Added file 'lib/net45/VDS.AppCore.Formatters.dll'. 
2017-08-16T03:14:27.6937601Z Added file 'lib/net45/VDS.AppCore.Formatters.pdb'. 
2017-08-16T03:14:27.6937601Z Added file 'package/services/metadata/core-properties/d049e0823aea40cdba6267568d619a5d.psmdcp'. 
2017-08-16T03:14:27.6937601Z Added file 'src/CsvFormatter.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/DataFormatters.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/DefaultFormatters.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/Formatters.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/IDataFormatter.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/IDataFormatters.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/IFlatFormatter.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/IFormatters.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/Properties/AssemblyInfo.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'src/XlsFormatter.cs'. 
2017-08-16T03:14:27.6937601Z Added file 'VDS.AppCore.Formatters.nuspec'. 
2017-08-16T03:14:27.6937601Z 
2017-08-16T03:14:27.6937601Z Successfully created package 'd:\a\1\a\VDS.AppCore.Formatters.2.0.1.71.nupkg'. 
2017-08-16T03:14:27.7427599Z ##[section]Finishing: NuGet pack Formatters nuspec 
+0

すでにエラーを見ている場合、それはNugetタスクやビルドタスクにありますか? – BikerDude

+1

@BikerDudeこれは、上記のナゲットパックタスクにあります。スクリプトの初期段階でソリューションを構築するタスクがあります。 –

+0

$(PackageVersion)をPackageVersionに変更した後で詳細ビルドログをここに投稿できますか? –

答えて

4

変数は$なしでここで使用する必要があります。したがって、PackageVersionを直接使用する必要があります。

enter image description here

+0

自分のVSTSでこれを試しましたが、動作していないようです。 – BikerDude

+0

@BikerDudeヒントメッセージは、「i」アイコンをクリックすると表示されます。およびBTWでは、変数を定義する必要があります。ビルド定義で変数 'PackageVersion'を定義しなかった場合は、エラーメッセージが表示されます。 –

+0

@ Marina-MSFTありがとう、それは問題を解決しました。バージョンに使用されるEnivronment変数が、上記のセクションで使用されているものとは異なる構文を持つのはなぜですか? –

関連する問題