0

Is there any way to swap the hard-coded net45 seen below with whatever is specified as the Target framework in my project settings?

<files>
    <file src="bin\$configuration$\$id$.pdb" target="lib\net45\" />
</files>

I was hoping to see something like:

<files>
    <file src="bin\$configuration$\$id$.pdb" target="lib\$targetframework$\" />
</files>

I don't want my team to have to remember to update the nuspec file whenever the project is upgraded.

It's worth noting that the dll itself makes it's way into the net45 folder without any extra cajouling.

Cheers

Craig
  • 417
  • 3
  • 12
  • How you pack you projects? PS script runs nuget.exe and performs the `nuget.exe pack` command? Or `nuget.exe` runs from MSBuild script? Or used MSBuild Pack target? – UserName May 16 '18 at 08:02
  • I use a Post-build event using nuget pack. Essentially as follows: `nuget pack $(ProjectPath) -Prop Configuration=$(ConfigurationName)` then `nuget add $(ProjectName).@(VersionNumber).nupkg -source %PACKAGES_FOLDER%` – Craig May 16 '18 at 10:03
  • Just try pass `targetframework` parameter as `nuget pack` property, similarly `ConfigurationName` – UserName May 16 '18 at 10:59
  • Ah... I understand the -Prop option now, but there does not appear to be a macro that produces net45, net451, net461, etc. – Craig May 18 '18 at 06:52
  • I've now removed my .nuspec file and am trying to include my .pdb files via the AllowedOutputExtensionsInPackageBuildOutputFolder setting in the .csproj file. Thus far I have been unsuccessful. – Craig May 18 '18 at 07:09

0 Answers0