English 中文(简体)
5. 采购Nant. 邮务司
原标题:Getting Nant.MailLogger to work on Windows 2008

I have had a NAnt/NAntContrib build running for a while on one machine:
(MS Windows Server 2003 Standard 32-bit SP2)

And I now need to run the same build script on a newer machine:
(Windows Server Standard 2008)

I have gotten NAnt and NAnt.Config installed and working on the new machine.
I am using NAnt.Core.Maillogger on the original machine, configured as such:

<property name="MailLogger.mailhost"        value="mail.server.com" />
<property name="MailLogger.from"            value="autobuild@hostredacted.com" />
<property name="MailLogger.failure.notify"  value="true" />
<property name="MailLogger.success.notify"  value="true" />
<property name="MailLogger.failure.to"      value="team@hostredacted.com" />
<property name="MailLogger.success.to"      value="team@hostredacted.com" />
<property name="MailLogger.failure.subject" value="AUTOBUILD: Failure on TEST" />
<property name="MailLogger.success.subject" value="AUTOBUILD: Success on TEST" />
<property name="MailLogger.failure.attachments" value="MailLogger.failure.files" />
<property name="MailLogger.success.attachments" value="MailLogger.success.files" />

<fileset id="MailLogger.failure.files"> 
    <include name="build.log" /> 
</fileset>
<fileset id="MailLogger.success.files"> 
    <include name="build.log" /> 
</fileset>

我操作了一个非常简单的测试文件,测试邮件功能:

<target name="test_mail_pass">
    <echo message="Test Success:
run by ${environment::get-user-name()}"/>
</target>

<target name="test_mail_fail">
    <echo message="Test Fail:
run by ${environment::get-user-name()}"/>
    <fail message="Some Failure occurred." />
</target>

The above works on the original machine, and seems to work on the new machine, except for the fact that no mail is sent. There is no message in the console that indicates that anything went wrong (ignoring the obvious use of the <fail> task).

我甚至不知道在什么地方开始混淆这里的错误,或如何解决这一问题。

任何援助都将受到高度赞赏。

最佳回答

I have solved this problem with much Google-ing.
One of two things solved my problem, and I don t know which it was, but my problem is now solved.

  1. 我的批量档案需要具备以下指挥线选择:

    -logger:NAnt.Core.MailLogger
    
  2. The file that was referred to in the:

    <fileset id="MailLogger.failure.files">
        <include name="build.log" /> 
    </fileset>
    <fileset id="MailLogger.success.files"> 
        <include name="build.log" /> 
    </fileset>
    

Need to actually exist.
One post I read (lost the link) told of a problem where if the files to attach do not exist, the Mail will just not get sent.

问题回答

暂无回答




相关问题
Create directory using Nant

Not sure if I m just totally missing it but I couldn t not figure out how to create a new directory using Nant. Is there built in functionality to do this? Can I just use the command prompt? I tried ...

Setting write permissions on godaddy hosting

I have godaddy asp.net hosting. Every time I upload the build, it’s a manual laborious task of setting write permissions (to folders) through the web interface. Is this any way to automate this ...

What are solid NMaven or build servers for .NET alternatives?

Maven had a long history and is well supported in the Java world. NMaven has received a less successful start and has never become as popular in the C#/.NET world as its larger cousin was in the Java ...

Gallio and MbUnit in NAnt

I am trying to use Gallio (v3.1)/MbUnit/NCover to run a unit test in my C# code, as part of the build process for my continuous integration system. I can get Gallio.Echo.exe to execute the tests and ...

TeamCity NUnit test result visualisation

Is there any way to produce visual results of NUnit tests from within TeamCity s "Tests" tab, currently my NAnt script outputs an .xml file of the results using the following task: <nunit2 ...

building .net applications without Visual Studio

I m interested to hear about people working with building .net applications using MSBuild, NAnt or similar tools. What are you using, why are you using it instead of the VS IDE? I like to use ...

热门标签