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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:50:55+00:00 2026-05-31T22:50:55+00:00

So, I’m finally really needing to do something with Web.config that isn’t supported by

  • 0

So, I’m finally really needing to do something with Web.config that isn’t supported by NuGet’s Web.config.transform system.

And after spending 2 hours searching the docs, I realized that there’s no word on whether Install.ps1 happens before or after Web.config.transform gets applied.

I used to define a Web.config.transform file like this:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="resizer" type="ImageResizer.ResizerSection"/>
  </configSections>
</configuration>

Here’s the new one – the requirePermission="false" attribute is required to support Medium Trust.

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="resizer" type="ImageResizer.ResizerSection" requirePermission="false"/>
  </configSections>
</configuration>

If I release a new Web.config.transform version, it will crash their ASP.NET project since there will be two section elements:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="resizer" type="ImageResizer.ResizerSection" />
    <section name="resizer" type="ImageResizer.ResizerSection" requirePermission="false"/>
  </configSections>
</configuration>

If Install.ps1 happens before Web.config.transform, I can just delete all matches to configuration/configSections/section[@name='resizer']. If it happens after, then I need to select one of the duplicates to remove.

This is a pretty easy problem to solve, but hasn’t yet been answered on an internet forum, and by posting it I’m hoping to make the next Nuggetter’s life easier.

  • 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-05-31T22:50:56+00:00Added an answer on May 31, 2026 at 10:50 pm

    I just read through NuGet code and install.ps1 happens after Web.config.transform.

    In NuGet’s code below, Web.config.transform is called in the ExtractPackageFilesToProject while installs.ps1 is called in the last event OnPackagageReferenceAdded :

        protected void AddPackageReferenceToProject(IPackage package)
        {
            PackageOperationEventArgs args = CreateOperation(package);
            OnPackageReferenceAdding(args);
    
            if (args.Cancel)
            {
                return;
            }
    
            ExtractPackageFilesToProject(package);
    
            Logger.Log(MessageLevel.Info, NuGetResources.Log_SuccessfullyAddedPackageReference, package.GetFullName(), Project.ProjectName);
            OnPackageReferenceAdded(args);
        }
    
    
        private void OnPackageReferenceAdded(object sender, PackageOperationEventArgs e)
        {
            Project project = FindProjectFromFileSystem(e.FileSystem);
            Debug.Assert(project != null);
            _providerServices.ScriptExecutor.ExecuteScript(e.InstallPath, PowerShellScripts.Install, e.Package, project, this);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a

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.