需要有关TFS2010 +自动构建+“构建配置=调试”的帮助 [英] Need some assistance with TFS2010 + an automated Build + 'Configurations to Build = Debug'

查看:74
本文介绍了需要有关TFS2010 +自动构建+“构建配置=调试”的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

真的。奇怪的。



当我执行 TFS团队建设(使用 Remote Deploy ),某些 #if调试



没有什么难的。那说... 请帮助编译器。



我拥有的代码如下:-

  #if DEBUG 
Log.Debug(我们处于DEBUG模式。);
#else
Log.Debug(我们在调试模式下_NOT_。);
#endif

因此,当调用此代码(在aspx页面中)时,它会打印我们处于调试模式。




  • Localhost(本地主机配置:调试)

  • 带有 manual <的远程服务器/ em>一键重新部署(本地主机配置:调试)



但是当我让TFS的持续集成开始时就不会。

>

FML。



我尝试查看是否为CASING情况(即#如果进行调试 #if调试),但仍然无法正常工作。



然后,我什至试图明确地告诉MSBuild配置...。






仍然没有爱。



哦..但这是软木塞!我 ALSO 有一些web.config转换




  • web.config

  • web.debug.config

  • web.release.config



...并可以你猜哪个文件被转换了?如果您猜出了 all 场景的web.debug.config……甚至是团队构建中的代码错误,那将是赢家!因此,就像构建过程和工作流知道它是 DEBUG 配置..咯咯!



最后,更改 debug = true debug = false 没有区别。



在我跳出这座大楼之前,有人可以帮忙吗?当这些怪异的屁股问题不断出现在我的生活中时,它使我丧命。 叹气



请帮助!



注意:我不能再接受捐赠了世界上最小的小提琴-已经给了我很多。干杯:)

解决方案

好吧,我找到了答案,但我对此不太满意。我将制作一个有关此错误的视频,并将其通过电子邮件发送给Vishal @ MS ...,以了解他的想法:)



无论如何,如果您仔细看一下默认配置无处不在就是这个...



调试|任何Cpu






那里没什么异常...



现在,当我将平台更改为 AnyCpu 时(请注意我如何



例如。.






让我想到的是当我签出.proj文件时.....这是其中的一小段....

 <?xml version = 1.0 encoding = utf-8?> 
< Project ToolsVersion = 4.0 DefaultTargets = Build xmlns = http://schemas.microsoft.com/developer/msbuild/2003>
< PropertyGroup>
< Configuration Condition =‘$(Configuration)’==’’> Debug< / Configuration>
< Platform Condition ='$(Platform)'==’’> AnyCPU< / Platform>
< ProductVersion> 9.0.30729< / ProductVersion>
< SchemaVersion> 2.0< / SchemaVersion>
...为简洁起见...
< SccProvider> SAK< / SccProvider>
< / PropertyGroup>
< PropertyGroup Condition = = $(Configuration)| $(Platform)'==‘Debug | AnyCPU'>
< DebugSymbols> true< / DebugSymbols>
< DebugType>完整< / DebugType>
...为简洁起见...
< DesktopBuildPackageLocation />
< / PropertyGroup>
< PropertyGroup Condition = = $(Configuration)| $(Platform)'==‘Release | AnyCPU'>
< DebugType> pdbonly< / DebugType>
...为简洁起见...
< CodeAnalysisRuleSet> AllRules.ruleset< / CodeAnalysisRuleSet>
< / PropertyGroup>

所以是的..我已修复它,但不确定是否可以接受或只是or幸。我需要从MS团队那里得到一些真实的答案:)


really. weird. shiz.

When I do a TFS Team Build (with Remote Deploy), some #if DEBUG preprocessor directives code I have on a web page does not get called. When i manually one-click deploy (remote deploy) the preprocessor directive code works. When I debug locally, the code also works.

So - problem looks to be related to my configuration settings for the Build Template i have (I think??). So, this is what I have :-

Nothing too hard. That says ... Please kind Compiler. Build my project (read: project, NOT solution) in 'DEBUG' mode.

The code i have is the following :-

#if DEBUG
    Log.Debug("We are in DEBUG mode.");
#else
    Log.Debug("We are _NOT_ in DEBUG mode.");   
#endif

So when this code (in some aspx page) is called, it prints out "We are in DEBUG mode." when it's

  • Localhost (Localhost Configuration: Debug)
  • Remote server with manual One-click reploy (Localhost Configuration: Debug)

But not when i let TFS's continuous intergration kick in.

FML.

I've tried to see if it was a CASING situation (ie #if debug or #if Debug) but it still doesn't work.

I then even tried to explicitly tell MSBuild the configuration....

Still no love.

Oh .. but this is the corker! I ALSO have some web.config transformations

  • web.config
  • web.debug.config
  • web.release.config

... and can u guess which file get's transformed ?? Winner if u guessed web.debug.config for all scenario's ... even the team build which is erroring in the code! So it's like the build process and workflow knows it's a DEBUG configuration .. kewl! but the compiled code doesn't???

Lastly, changing debug="true" or debug="false" makes no difference.

Can someone please help before I jump out of this building? It kills me when, constantly, these weird ass issues pop up in my life. sigh

Please help!

NOTE: I cannot accept anymore donations for the world's smallest violin - I have been given plenty already. Cheers :)

解决方案

Well, I found the answer, but I'm not too happy with it. I'll make a video of this bug and email it off to Vishal @ MS ... to see what he thinks :)

Anyways, if you look carefully at the default configuration everywhere it is this...

DEBUG | Any Cpu

nothing unusual there...

Now, when I change the platform to AnyCpu (notice how i removed the space....) it now works fine.

eg..

What made me think about that was when i checked out the .proj file... .. here's a snippet of that....

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
... snip for brevity ...
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
... snip for brevity ...
    <DesktopBuildPackageLocation />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
... snip for brevity ...          
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>

so yeah .. i fixed it but i'm not sure if that is acceptable or just a fluke. I'll need to get some real answers from the MS team :)

这篇关于需要有关TFS2010 +自动构建+“构建配置=调试”的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆