Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7950455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:16:39+00:00 2026-06-04T02:16:39+00:00

I want to create custom NANT files. To do this, I use C# to

  • 0

I want to create custom NANT files. To do this, I use C# to create a “.build” file using the input from the user, I wish to create a custom build. I already have a build file, but each time I’m making a new project I have to create a new build file, so I would like only to input some information into a C# form and then the file would be auto-generated.

I tried with XmlTextWriter witch works fine for the header of my build file, but I get problems when I get to line like this :

<property name= "name" value = "test"/> . 

With XmlTextWriter line are like this :

<description>This is a test.</description> .

So I wonder how could I write my NANT script.

It doesn’t have to be with XmlTextWrite …

  • EDIT –

I found a way:

textWriter.WriteRaw("<property name = \"project.name\" value=\"" + projectName + "\" />");

result :

<property name = "project.name" value="test" />

I have to enter it “raw”, but it’s better than nothing. I’m still open to a better way to do it!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:16:41+00:00Added an answer on June 4, 2026 at 2:16 am

    I highly recommend against handcrafting your own XML through a non-XML specific text writer. This will cause pain with escaping characters, among other things.

    I might be missing something, but you should be able to use XmlTextWriter for this. This is untested but you should get the general idea:

    XmlTextWriter writer = new XmlTextWriter(...);
    
    writer.StartDocument();
    
    writer.WriteStartElement("property");
    writer.WriteAttributeString("name", "project.name");
    writer.WriteAttributeString("value", projectName);
    writer.WriteEndElement();
    
    writer.EndDocument();
    writer.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create custom error code and message mapping file. Currently I use
I want to create Custom UIButton with rectangular shape. for this I am using
i want create a custom json data from the mssql 2008 results so that
I want to create a custom navigation bar to put in my header.phtml file.
I want to create a custom property on one of my entities mapped from
i want to create the custom menu control in UIWebView, by using - (void)
impress.js is a new web presentation written using Javascript. I want to create custom
I want to create a custom View which contains two buttons without using xml.
I want to create a Custom Control derived from ComboBox , however if I
I want to create custom buttons to use in a TabHost. I haven been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.