« Previous Next »

Thread: Scripting sessionState sqlConnectionString error

Last post 04-02-2009 8:58 AM by timbe. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 04-01-2009, 10:47 AM

    • timbe
    • Not Ranked
    • Joined on 04-01-2009, 8:58 AM
    • Posts 5

    Scripting sessionState sqlConnectionString error

    I'm attempting to update the sessionState sqlConnectionString value for a site with appcmd, via the following:

    appcmd set config "SiteName" /section:sessionState /sqlConnectionString:Server=connectionString /commit:site

    This is the result returned:

    Applied configuration changes to section "system.web/sessionState" for "MACHINE/ WEBROOT/APPHOST/SiteName" at configuration commit path "MACHINE/WEBROOT/APPHOST/ SiteName" ERROR ( hresult:c00cee2c, message:Failed to commit configuration changes. )

    The site's web.config is not updated after running the command. The issue feels like a file permissions thing, but I haven't been able to find any details related to the error code. A few notes:

    * "SiteName" and "sqlConnectionString" are dummy values for the purpose of this post.
    * The command prompt is being run as Administator
    * The account logged in is in the Administrators group
    * The site's web.config file permissions are set to full control for System, Administrator, Users, and IIS_IUSRS (as a test)
    * The WWW Publishing service is in the stopped state
    * Environment is Windows Server 2008 64bit
  • 04-01-2009, 1:00 PM In reply to

    • rlucero
    • Top 50 Contributor
    • Joined on 09-29-2006, 3:35 PM
    • Seattle, WA
    • Posts 164

    Re: Scripting sessionState sqlConnectionString error

    Based on what I got out of Configuration Editor for this section, I dont' know if you need the /commit:site tag.

    Also, make sure your connection string stuff is in quotes.

  • 04-01-2009, 1:18 PM In reply to

    • timbe
    • Not Ranked
    • Joined on 04-01-2009, 8:58 AM
    • Posts 5

    Re: Scripting sessionState sqlConnectionString error

    Thanks for the post. I quoted the connection string value and removed the /commit:site. Unfortunately, I got the same "hresult:c00cee2c" error.
  • 04-01-2009, 2:16 PM In reply to

    • rlucero
    • Top 50 Contributor
    • Joined on 09-29-2006, 3:35 PM
    • Seattle, WA
    • Posts 164

    Re: Scripting sessionState sqlConnectionString error

    Did you do this?

     /sqlConnectionString:Server="connectionString"

    I think for this to work it needs to be /sqlConnectionString:"ConnectionStringStuffHere"

  • 04-01-2009, 2:34 PM In reply to

    • timbe
    • Not Ranked
    • Joined on 04-01-2009, 8:58 AM
    • Posts 5

    Re: Scripting sessionState sqlConnectionString error

    Thanks for your help--
    I've tried several variations including:

    C:\Windows\System32\inetsrv>appcmd set config "SiteName" /section:sessionState /sqlConnectionString:"Server=sqlServerConnectionString"

    and

    C:\Windows\System32\inetsrv>appcmd set config "SiteName" /section:sessionState /sqlConnectionString:'Server=sqlServerConnectionString'

    ...which returns the error. Interestingly enough, the same error code is returned if I do /sqlConnectionString:Server="sqlServerNameValue", which leads me to believe that the syntax isn't the problem.
  • 04-01-2009, 2:38 PM In reply to

    • rlucero
    • Top 50 Contributor
    • Joined on 09-29-2006, 3:35 PM
    • Seattle, WA
    • Posts 164

    Re: Scripting sessionState sqlConnectionString error

    appcmd set config "SiteName" /section:sessionState

    Change it to /section:system.web/sessionState .  I think that might be it.

  • 04-01-2009, 4:25 PM In reply to

    • timbe
    • Not Ranked
    • Joined on 04-01-2009, 8:58 AM
    • Posts 5

    Re: Scripting sessionState sqlConnectionString error

    Same result, unfortunately...
  • 04-02-2009, 8:58 AM In reply to

    • timbe
    • Not Ranked
    • Joined on 04-01-2009, 8:58 AM
    • Posts 5

    Re: Scripting sessionState sqlConnectionString error

    The problem appears to related to appcmd and its ability (or lack thereof) to write ANY configuration changes. I tried running a simple set command on another section of the config and got the same error hresult. For example:

    appcmd set config "SomeSite" /section:defaultDocument /enabled:false

    which is straight from a basic usage example. As I mentioned in the initial post, I'm running as a user from the Administrator's group, with elevated permissions via "Run as Administrator", so I'm at a bit of a loss as to why it doesn't work.

    Thanks, rlucero for your input.
Page 1 of 1 (8 items)
Microsoft Communities