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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:20:12+00:00 2026-05-28T07:20:12+00:00

I am creating NuGet package and for that I have created Nuspec manifest file.

  • 0

I am creating NuGet package and for that I have created Nuspec manifest file. In content folder I have two files, test.exe and test.config. Now I would like to change property “Copy To Output Directory” of these the files to “Copy Always” in project, when any user installs this package.

I found related question NuGet how to apply properties to files, that shows can do this using PowerShell install.ps1 script, but I have no idea how to create that file.

  • 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-28T07:20:13+00:00Added an answer on May 28, 2026 at 7:20 am

    Your install.ps1 file should look something like this.

    param($installPath, $toolsPath, $package, $project)
    
    $file1 = $project.ProjectItems.Item("test.exe")
    $file2 = $project.ProjectItems.Item("test.config")
    
    # set 'Copy To Output Directory' to 'Copy if newer'
    $copyToOutput1 = $file1.Properties.Item("CopyToOutputDirectory")
    $copyToOutput1.Value = 2
    
    $copyToOutput2 = $file2.Properties.Item("CopyToOutputDirectory")
    $copyToOutput2.Value = 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a nuget package that I want to be compatible for both MVC2
I am creating NuGet Package and facing one issue that how can i apply
I'm creating my first nuget package. I added a dependency with a version that
I'm interested in creating a NuGet package for a documentation tool I'm writing. Ideally,
Creating an installer for possible remote systems so that if they do not have
Creating a class that implements DynamicObject public class Test : DynamicObject { public override
Is it possible to publish a nuget package with source code and pdb files
I am creating a NuGet package, and I would like the package to display
I am creating a nuget package and I want it to add a post-build
I'm creating a small application that I will distribute via NuGet. My web app

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.