Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Azure DevOps / Pipelines: Set the “Build Action” and “Copy To Output Directory” properties of a content file in a NuGet package

$
0
0

I am creating a .net Standard 2.0 NuGet package and I want to deploy a config file and mark this file as “Content” and “Copy if Newer”.When I install the package, the config file is deployed at the root of the project, but the properties are set to the default values: “None” and “Do Not Copy”.I tried to solve the problem with an inline powershell script in azure pipelines:

- powershell: | $project= Get-Project Foo $project.ProjectItems.Item("foo.config").Properties.Item("CopyToOutputDirectory").Value = 2 $project.ProjectItems.Item("foo.config").Properties.Item("BuildAction").Value = 2

but I got the following error:

Get-Project : The term 'Get-Project' is not recognized as the name ofa cmdlet, function, script file, or operable program...

Is there a way to set these properties in a pipeline task?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>