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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:06:27+00:00 2026-06-14T06:06:27+00:00

I’m a newbie at SharePoint 2010. I right-click on the project, select Deploy if

  • 0

I’m a newbie at SharePoint 2010. I right-click on the project, select Deploy if I want to deploy locally. The Site URL on the project is set to my local machine. If I want to deploy to the QA server, I select Deploy, navigate to the Debug/Release folder, grab the .wsp file, logon to the Central Administration on QA, retract the solution, then do Add-SPsolution <path to wsp file> through powershell, go back to Central Admin, the click on Deploy solution for that package. Works fine.

The web.config on my local machine has a custom connection string, and appsettings. When I deploy the package on the QA server, I’m manually changing the connection string and appsettings specific to QA. I want to automate this process. I want the web.config to be part of the package with it’s own custom connecting string (one for local, one for QA, and for Production) and appsettings. How do I do it? The goal is on a new machine, I should be able to deploy the wsp and appsettings+web.config should all be correct without modifying anything manually. How do I accomplish this?

  • 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-14T06:06:29+00:00Added an answer on June 14, 2026 at 6:06 am

    I am pretty sure web.config modifications can’t be done with just package files / CAML.

    However, what can be done is to deploy a WebApplication Feature Reciever which modifies the web.config through SPWebApplication.WebConfigModifications.

    Here is a snippet of code from my project, see the the Code Project KB for more details: (This first bit is just a handy function with some notes.)

    // For WebConfigModifications access,
    // see http://www.codeproject.com/KB/sharepoint/SPWebConfigModTool.aspx
    // Hints:
    // app.WebConfigModifications.Add(new SPWebConfigModification
    //    {
    //        Type =     [add/update child node?]
    //        Path =     [XPath of parent node]
    //        Name =     [XPath to identify child node UNIQUELY]
    //        Owner =    [Use GUID to identify as ours]
    //        Sequence = [Sequence number, likely 0 for only one]
    //        Value =    [XML node to add/update]
    //    });
    void ModfiyWebConfig (SPWebApplication app, string path, string name, XElement node)
    {
        app.WebConfigModifications.Add(new SPWebConfigModification
        {
            Type = SPWebConfigModificationType.EnsureChildNode,
            Path = path,
            Name = name,
            Owner = OwnerId,
            Sequence = 0,
            Value = node.ToString(),
        });
    }
    

    Get/init SPWebApplication

    var app = properties.Feature.Parent as SPWebApplication;
    

    Queue/setup modifications

    ModfiyWebConfig(app,
                "configuration/system.webServer/modules",
                "add[@name='ASPxHttpHandlerModule']",
                new XElement("add",
                    new XAttribute("name", "ASPxHttpHandlerModule"),
                    new XAttribute("type", aspxHandlerModule)));
    

    Apply modifications

    app.WebService.ApplyWebConfigModifications();
    app.Update();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img
I'm trying to select an H1 element which is the second-child in its group
I want to construct a data frame in an Rcpp function, but when I

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.