Msbuild Team Foundation Server 2010——未设置项目的生成配置

Msbuild Team Foundation Server 2010——未设置项目的生成配置,msbuild,Msbuild,(我更新了标题,以反映我的新发现) 我刚刚将一系列项目从TFS2008移植到TFS2010,但在一个特定项目中遇到了(实际上有几个:)问题。使用生成配置“调试”进行编译时,一切正常。但是,在使用生成配置“Release”进行编译时,由于al.exe在“obj\debug”中找不到指定的文件,我收到一个链接器错误 错误: Task "AL" (TaskId:781) ... ALINK : error AL1047: Error importing file 'c:\Builds\23\...\o

(我更新了标题,以反映我的新发现)

我刚刚将一系列项目从TFS2008移植到TFS2010,但在一个特定项目中遇到了(实际上有几个:)问题。使用生成配置“调试”进行编译时,一切正常。但是,在使用生成配置“Release”进行编译时,由于al.exe在“obj\debug”中找不到指定的文件,我收到一个链接器错误

错误:

Task "AL" (TaskId:781)
...
ALINK : error AL1047: Error importing file 'c:\Builds\23\...\obj\Debug\someproject.exe' -- The system cannot find the file specified. [C:\Builds\23\...\Release\Sources\...\someproject.csproj]
  The command exited with code 1. (TaskId:781)
Done executing task "AL" -- FAILED. (TaskId:781)
我已启用team build info诊断日志记录,并找到以下变量:

IntermediateOutputPath = obj\Debug\
我的问题是,当我在发布配置下构建时,为什么链接器会在调试文件夹中查找。我已经检查了解决方案和项目配置,发布解决方案配置下没有“调试”配置。你知道为什么会发生这种情况以及如何解决吗

提前谢谢

!!奖金信息

我在项目文件中有以下失败的语句,确保如果未指定构建配置,它将被设置为Debug

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
调试

我尝试将其更改为默认版本,但现在我的调试团队构建失败,指向obj\Release。因此,在编译项目时,似乎未指定构建配置。这是怎么回事?

发现了问题。我必须为someproject.csproj项目文件中定义的发布目标明确设置生成配置。我插入了行“配置=发布”

    <MSBuild ToolsVersion="3.5" Projects="$(SolutionRoot)\...someproject.csproj"
             Properties="RunCodeAnalysis=false;
                             Configuration=Release;
                             ClrVersion=2.0.50727.0;
             ApplicationVersion=$(VersionNumber);
             UpdateUrl=$(DevtestUpdateUrl);
             InstallUrl=$(DevtestInstallUrl);
             IsWebBootstrapper=true;
             PublishDir=$(DropLocation)\$(BuildNumber)\Publish\Update\;
             SolutionDir=$(SolutionRoot)\Kl******\;
             DeploymentConfiguration=devtest;
             SignManifests=true;
                        ManifestCertificateThumbprint=23...23;"
             Targets="PublishOnly" />

找到了问题。我必须为someproject.csproj项目文件中定义的发布目标明确设置生成配置。我插入了行“配置=发布”

    <MSBuild ToolsVersion="3.5" Projects="$(SolutionRoot)\...someproject.csproj"
             Properties="RunCodeAnalysis=false;
                             Configuration=Release;
                             ClrVersion=2.0.50727.0;
             ApplicationVersion=$(VersionNumber);
             UpdateUrl=$(DevtestUpdateUrl);
             InstallUrl=$(DevtestInstallUrl);
             IsWebBootstrapper=true;
             PublishDir=$(DropLocation)\$(BuildNumber)\Publish\Update\;
             SolutionDir=$(SolutionRoot)\Kl******\;
             DeploymentConfiguration=devtest;
             SignManifests=true;
                        ManifestCertificateThumbprint=23...23;"
             Targets="PublishOnly" />