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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:09:17+00:00 2026-06-03T17:09:17+00:00

what I have in app.config is this <?xml version=1.0?> <configuration> <configSections> <sectionGroup name=applicationSettings type=System.Configuration.ApplicationSettingsGroup,

  • 0

what I have in app.config is this

<?xml version="1.0"?>
<configuration>
   <configSections>
      <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
          <section name="Porject.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
     </sectionGroup>
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
  <applicationSettings>
    <Porject.Properties.Settings>
        <setting name="PhotoLocation" serializeAs="String">
            <value>.\photos\</value>
        </setting>
    </Porject.Properties.Settings>
</applicationSettings>

<connectionStrings>
   <add name="****" connectionString="Data Source=***;Initial Catalog=****;User ID=***;Password=***" />
</connectionStrings>

</configuration>

and this is how I call the PhotoLocation:

  string s = ConfigurationManager.AppSettings["PhotoLocation"];

When I make a request to get the connectionstring, there is no problem and it works fine; but when I requst the PhotoLocation it returns null.
Also the ConfigurationManager.AppSettings.Count returns 0.

Does anyone have an idea on what I’m doing wrong?

  • 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-03T17:09:20+00:00Added an answer on June 3, 2026 at 5:09 pm

    simply add this in your App config file

    <appSettings>
    
        <add key="PhotoLocation" value=".\photos\"/>
    
    <appSettings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a following configSection in App.Config. <?xml version=1.0 encoding=utf-8 ?> <configuration> <configSections> <section
is it possible to have app.config file like this : <?xml version=1.0 encoding=utf-8 ?>
If I create an app.config file in a console apps like this <?xml version=1.0
first of all, I have a .NET 4.0 application with this configuration: <?xml version=1.0?>
I've got an app.config file, which contains the following <?xml version=1.0 encoding=utf-8 ?> <configuration>
I have been trying to work with app.config sections by this example: http://msdn.microsoft.com/en-us/library/system.configuration.configurationcollectionattribute.aspx#Y2391 and
I have defined a config section in my app.config in the following way: <?xml
I have created a library which reads the app.config file and gets the type
I have a the following server side app.config for a WCF service: <system.serviceModel> <bindings>
I have a WCF service hosted in IIS7. This is the app.config for my

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.