How to add ApplicationSettings to web.config

4 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 07 Apr 2011 Link to this post

    I'm calling from a webpage and I have some variables in my settings that are not connection strings (just strings).  I can add the connection strings to the web.config ok, but the application settings don't seem to work. 
    Here is what's in the report app.config or myReport.dll.conifg
    <applicationSettings>
        <MyReport.Properties.Settings>
            <setting name="MyVariable" serializeAs="String">
                <value>Test123</value>
            </setting>
        </MyReport.Properties.Settings>
    </applicationSettings>

    My guess was to use:

    <appSettings>
        <add key="MyReport.Properties.Settings.MyVariable" value="Test123"/>
          </appSettings>

    Does the MyReport.dll.config do anything if you put it in the bin of your website/ webservice?

  2. Massimiliano Bassili
    Massimiliano Bassili avatar
    323 posts
    Member since:
    May 2006

    Posted 11 Apr 2011 Link to this post

    I'm not sure I get your question and its relevance to the Reporting product. I assume MyReport.dll is the compiled class library where your reports reside i.e. standard class library with standard .NET classes in it (that is what Telerik Reports are, after all).
    You can find more information on applications settings in MSDN respective articles: Managing Application Settings.

    Cheers!
  3. DevCraft banner
  4. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 11 Apr 2011 Link to this post

    I can't add Application Settings for a website though.  My connection string works fine when I set it in the web.config, then the .dll uses it.  There is appSettings but not applicationSettings
  5. Answer
    Massimiliano Bassili
    Massimiliano Bassili avatar
    323 posts
    Member since:
    May 2006

    Posted 12 Apr 2011 Link to this post

    Those should be helpful: Cheers!
Back to Top