-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy to ouput for content files not working #1908
Comments
Disagree that nuget pack should fail. It should issue a warning that the Jeff On Sun, Jan 10, 2016 at 4:57 PM, Mordechai Zuber notifications@github.com
|
That works fine for me also. |
I agree with @csharpfritz a warning for incorrect rules would be helpful. The contentFiles section of the nuspec is consumed by the client during restore, not during pack time. @M-Zuber the package needs to have the structure of |
Well now it is not even transferring the files at all. <?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>Mordechai Zuber</authors>
<owners>Mordechai Zuber</owners>
<licenseUrl>https://github.com/TycheOrg/Tyche/blob/master/License.md</licenseUrl>
<projectUrl>https://github.com/TycheOrg/Tyche/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A simple util for generating random names usefull for naming releases</description>
<releaseNotes>Initial release of Tyche.</releaseNotes>
<copyright>Copyright 2016</copyright>
<tags>Generator</tags>
<!--This is not transferring any files when installing the package-->
<contentFiles>
<files include="any/any/Data/*" copyToOutput="true" />
</contentFiles>
</metadata>
<files>
<!--This copies the files over, but can't control copyToOutput-->
<!--<file src="any/any/Data/" target="content"></file>-->
<file src=".\bin\Release\Tyche.dll" target="lib\"></file>
</files>
</package> |
Use files to add the items to the nupkg. contentFiles is used by the client when consuming the package to set the msbuild properties in the lock file. Items inside metadata are used by the client, items outside such as files are used at pack time. |
So if I want the contents of Data to be available in the bin after compiling the client I need both contentFiles and files targeted at the same location, correct? I have tried with the example posted with the only change being uncommenting the file element, but it still does not seem to work :( |
@emgarten In that case, the docs are pretty confusing:
(https://docs.nuget.org/create/nuspec-reference#content-files) This makes it sound like
That sounds an awful lot like what the pre-3.0 Now that I'm reading this with your comment in mind, I think I see the intent. Whereas I know there's been some talk about how NuGet should handle content packages going forward (and possibly rethinking this approach). Do you know which issue is the one for discussing that (I seem to have lost track)? |
@daveaglick we are going to update to documents, the process has been stalled a bit because of other higher priority work, but we are not forgetting about it. To make it clear: |
@M-Zuber Are the files showing up in the nupkg? |
Are you on update 1? |
@M-Zuber |
@yishaigalatzer yes. |
@M-Zuber are you using this with a UWP (project.json based) project? |
Update 1 yes, uwp no |
Project.json -> contentFiles The contentFiles section of the nuspec is also not used for packages.config/content. To change the copyToOutput property on a file from that folder you would need an install.ps1 script. |
So since its not using a project.json then I don't mean to sound snarky, just want to have it clear to know if it might not be easier to include the content within the code file itself |
@M-Zuber that's correct. project.json projects can be restored/updated outside of Visual Studio where only contentFiles can be used. Project.json will not use install.ps1 or content, only contentFiles. |
As my use case was minimal enough, I simply included the needed data in the code file. |
Kindly end the thread by either specifying the working details to extract 'content' from nuget into ASP.NET project or by redirecting to a related link. Thank you. |
Looks like, this is still an issue. Is there any plan to resolve this issue in near future? |
I'm getting this issue also |
@sharifmamun @hisuwh the problem here was that the package was authored incorrectly. Please read the current docs on contentFiles and double check that your packages are authored correctly. There are currently no known bugs or issues with this setting for contentFiles, if you encounter one please open a new issue so that it can be investigated. |
With a nuspec like the following
It packs properly, but does not actually set the
copyToOutput
to the wanted value.I will assume that is because the value for
include
does not follow the conventions. If that is the case, then I would thinknuget pack
should fail.The text was updated successfully, but these errors were encountered: