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 8607833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:27:32+00:00 2026-06-12T03:27:32+00:00

I am making a Windows Service . The Service has to donwload something every

  • 0

I am making a Windows Service. The Service has to donwload something every night, and therefor I want to place the URI in the App.Config in case I later need to change it.

I want to write an URI in my App.Config. What makes it invalid and how should i approach this?

<appSettings>
    <add key="fooUriString" 
         value="https://foo.bar.baz/download/DownloadStream?id=5486cfb8c50c9f9a2c1bc43daf7ddeed&login=null&password=null"/>
</appSettings>

My errors:

- Entity 'login' not defined
- Expecting ';'
- Entity 'password' not defined
- Application Configuration file "App.config" is invalid. An error occurred
  • 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-12T03:27:33+00:00Added an answer on June 12, 2026 at 3:27 am

    You haven’t properly encoded the ampersands in your URI. Remember that app.config is an XML file, so you must conform to XML’s requirements for escaping (e.g. & should be &amp;, < should be &lt; and > should be &gt;).

    In your case, it should look like this:

    <appSettings>
        <add
            key="fooUriString" 
            value="https://foo.bar.baz/download/DownloadStream?id=5486cfb8c50c9f9a2c1bc43daf7ddeed&amp;login=null&amp;password=null"
        />
    </appSettings>
    

    But in general, if you wanted to store a string that looked like "I <3 angle bra<kets & ampersands >>>" then do this:

    <appSettings>
        <add
            key="someString"
            value="I &lt;3 angle bra&lt;kets &amp; ampersands &gt;&gt;&gt;"
        />
    </appSettings>
    
    void StringEncodingTest() {
        String expected = "I <3 angle bra<kets & ampersands >>>";
        String actual   = ConfigurationManager.AppSettings["someString"];
        Debug.Assert.AreEqual( expected, actual );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a Windows service which needs to continuously check for database entries
I am making a windows service to be able to run operations on a
I'm making a Windows Phone 7 app with a few different pivot pages. I
I am making a Windows Phone App at the moment and I run into
I have a windows service that is making a call out to an IIS
I've created a Windows Communication Foundation service (the appDomain in this case is a
I've been making changes to a Windows Service in Visual Studio (2010, .NET 4.0
I have a new Windows Service I'm making in C# 4.0. I'm trying to
I am making setup Project for my windows Service. while installing, user should enter
We install a windows service from a custom action as described here: CodeProject Every

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.