nant - Nantcontrib task -


I am trying to attach a log file to email.

My code is:

  ** & lt; Loadtasks assembly = "... / tasks.dll" /> & Lt; Record name = "c: foo \ log.txt" verb = "start" /> & Lt; Target name = "email" & gt; & Lt; = "Abc@foo.com" from mail tolist = "xyz@foo.com" topic = "build" message = "build fail" mailhost = "smtp.anywhere.net" & gt; & Lt; Files & gt; & Lt; Include name = "c: foo \ log.txt" /> & Lt; / Files & gt; & Lt; Attachment & gt; & Lt; Include name = "c: foo \ log.txt" /> & Lt; / Attachment & gt; & Lt; / Mail & gt; & Lt; / Target & gt; & Lt; Record name = "c: foo \ log.txt" action = "close" /> gt;   

This is my commandment:

  nant -f: filename.build email -l: c: foo \ log.txt   

I get the following error:

  System.Security.SecurityException: Request type 'for system permission. advertisement. Files File Drawing, mscorlib, Version = 4.0.0.0, Culture = neutral, Sarwajnikki token = b77a5c561934e089 'failed (System.O.FileSystemInfo.get_FullName) system System.Security.CodeAccessSecurityEngine.Check. Object demand, StackCrawlMa rk and StackMark, Boolean Hapreshr on System.Security.CodeAccessPermission.Demand () (on NAnt.Contrib.Tasks.RecordTask.ExecuteTask) NA.Core.Task.Execute () in NAnt.Core.Project.InitializeProjectDocument ( XmlDocument document) NAnt.Core.Project.Execute () in NAnt.Core.Project.Run ()   

I & lt; Record & gt; does not use functions, it returns another error, which could not attach the txt file to Bcoz, it is being used by another process.

Why am I having this error?

I do something like a flush in the record job, just to send an email to engage in email Before copying files, hope that this solution works

  & lt; Echo & gt; $ {EmailSubject} & lt; / Echo & gt; & Lt; Echo & gt; Sending email & lt; / Echo & gt; & Lt; Echo & gt; Attached file: $ {build.log.dir} / email_ $ {build.log.filename} & lt; / Echo & gt; & Lt; Echo & gt; Attached file: $ {path.vsshelper.log} / log / email_ $ {build.log.getlistoffiles} & lt; / Echo & gt; & Lt; Record name = "$ {build.log.dir} / $ {build.log.filename}" action = "flush" level = "verbose" /> & Lt; Sleeping milliseconds = "5000" /> & Lt; Copy file = "$ {build.log.dir} / $ {build.log.filename}" tofile = "$ {build.log.dir} / email _ $ {build.log.filename}" / & gt; & Lt; Copy file = "$ {path.vsshelper.log} / log / $ {build.log.getlistoffiles}" tofile = "$ {path.vsshelper.log} / log / email _ $ {build.log.getlistoffiles}" / & Gt;    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -