Closed 304NotModified closed 6 years ago
I think it found the issue, I still need a install.ps1?
@jainaashish @nkolev92 can any of you take a look at this?
I pretty sure it's my mistake. I read the docs wrong.
For maximum compatibility with consuming projects, a package ideally specifies the content files in both elements.
I did that, but before there was an install.ps1, and that one was missing now. For some reason I was thinking that the ps1 wasn't need with the <contentFiles>
config
@304NotModified You don't need install.ps1 with contentFiles. contentFiles => PackageReference, project.json content => packages.config
The asp.net project you have is probably a packages.config one, so for that content is used.
yes indeed, but I still need the install.ps1 for setting the buildAction etc when using packages.config. Correct?
@304NotModified Correct. Just wanted to make sure we're on the same page :)
OK thanks for the confirmation :) 👍
I am unable to get this working. I am having the same issue as #6404. As the title states, "ContentFiles, buildAction and copyToOutput wont work." This goes for a class library as well. Here is my .nuspec file:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>FIS</authors>
<owners>$author$</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>EMV Library</description>
<releaseNotes>First Version using TFS Build Definition.</releaseNotes>
<copyright>Copyright 2018</copyright>
<contentFiles>
<files include="EMVLibWrapper\*.dll" buildAction="None" copyToOutput="true" />
</contentFiles>
</metadata>
<files>
<file src="bin\$Configuration$\Psg.Common.*.dll" target="lib\net462" />
<file src="bin\$Configuration$\Psg.Common.*.pdb" target="lib\net462" />
<file src="App.config.install.xdt" target="content\" />
<file src="App.config.uninstall.xdt" target="content\" />
</files>
</package>
When I create the package the items in contentFiles do not apply "buildAction = None" nor "copyToOutput = true". Build action is set to "Content" and Copy to Output Directory is set to "Do not copy".
Please help. Thank you, Mark
we having also problems: see https://github.com/NLog/NLog/issues/2823
@mcpine9 ContentFiles
only applicable when installed into a project using PackageReference
... so if you're trying to install it with packages.config
then it won't work. You'd need to explicitly set those properties either through MSBuild targets (highly recommended) or powershell scripts like install.ps1...
Details about Problem
We have probably the same issue as https://github.com/NuGet/Home/issues/6404, but it's reproducible.
NuGet product ui: VS UI
NuGet version (x.x.x.xxx): 4.6.0
VS version (if appropriate): VS2017 (15.6.5),
OS version (i.e. win10 v1607 (14393.321)): win 10 enterprise
Worked before? If so, with which NuGet version: not that i'm aware of
Detailed repro steps so we can see the same problem
expected:
current:
...
Other suggested things
it works for a new ASP.NET Core website
the nuspec in the package:
The content of the nupkg:
Verbose Logs
Not sure which logs I could add .
Sample Project
not sure if useful, as it's an install thing.