Replacing Config Variables present in .nupkg of deploying Package

As part of Web application deployment process, I wanted to replace an appsettings variable (updateUrl) in an MyApp.exe.config file. Config variable replacement is working when the .config is inside the deploying package.
But my scenario is different. I have the .config file way inside the .nupkg which is present in my main deploying package as shown.

What I understand is that octopus will not search for a config file present inside a .nupkg file. Is there an any way to update the variable inside .nupkg config file.
I am using Octopus Deploy version 2018.2.5

Hi,

Thanks for getting in touch!. Yes, you are correct. That being said, can you provide me a bit more context regarding what is the end result you are looking for? Would it be ok if the nested nuget package MyApp-1.0.1-full was deployed using a separate step in the deployment process?

Regards,

Pawel

Hi,
Firstly, thanks for confirming that replacing the variables inside nested .nupkg is not possible.
So, what I am trying to achieve is deploying releases folder generated by squirrel.windows to IIS webapps of different client environments.
In detail I am looking for something like this:
-There is a generic nuget package as input which consists of: one or more nested nuget packages along with other files. (The number of nested .nupkg packages differ with each version)
-This generic nuget package has to be deployed to IIS website of the client environments.
-During deployment I want to change the appsettings values depending the client environment parameters.

Please note that as the nested nuget packages differ at each version, I cannot deploy this nested package (MyApp-1.0.1-full.nupkg or the others ) through separate step in the process.

Is there anything that I can try?

Hi,

If I understand correctly you want to preform variable substitution without extracting the nuget package. If that’s the case then unfortunately I don’t think this can be done.

The simplest solution I can think of is to unpack each package to a known location, perform variable substitution manually and then pack it back. This all can be done using nuget.exe.

Please let me know how you go.

Regards,

Pawel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.