未为项目TFS2012设置OutputPath属性

时间:2013-10-22 08:08:39

标签: tfs tfs2012 tfsbuild

我在Team Foundation服务器上有一个构建版本,它提供了这个交战:

  

C:\的Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Microsoft.Common.targets   (610):没有为项目设置OutputPath属性   'Plugin.DeploymentTool.csproj'。请检查以确保您   已指定Configuration和Platform的有效组合   这个项目。 Configuration ='Release'Blatter ='x86'。你可能   看到这条消息,因为你正试图建立一个没有的项目   解决方案文件,并指定了非默认配置或   该项目不存在的平台。

我找不到任何解决方案或为什么我会收到此错误。但后来我看了生成的zip文件,Binary文件夹是空的。我试图使用x86,x64和Any CPU,如果有任何差异,那就没有了。

如果我查看项目文件,它看起来没问题。

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

3 个答案:

答案 0 :(得分:45)

我找到了问题的解决方案,结果证明是一个非常简单的问题。 TFS Build中的默认配置如下所示: 配置:发布,平台:任何CPU

但在Visual Studio 2012中,它看起来像这样: 配置:发布,平台: AnyCPU

解决方案是删除TFS构建平台中Any和CPU之间的空间。现在它完美无缺。

<强>更新

此问题已在VS2013中得到纠正。

答案 1 :(得分:12)

对于Visual Studio Team Services(是Visual Studio Online)集成构建,@ mortenstarck的答案也可以解决问题。在构建的变量中,为anycpu指定BuildPlatform

build variables

在构建步骤中引用该变量:

build step

答案 2 :(得分:10)

除了其他答案,我注意到了这一点:

  1. 要构建 .sln (解决方案),您需要空间,因此必须为any cpu(注意空格)。< / p>

  2. 要构建 .csproj ,您不需要空格,因此必须为anycpu

相关问题