Skip to content
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

Will existing NuGet packages work if I am using PackageReference for WPF, Windows Forms or ASP.NET projects? #7398

Closed
JosepBalague opened this issue Oct 12, 2018 · 2 comments
Labels
Functionality:Pack Resolution:Question This issues appears to be a question, not a product defect

Comments

@JosepBalague
Copy link

template_net47.zip
Hi folks,

(VS2017 15.8.7; MSBUILD 15.8.169+g1ccb72aefa; OS Version 10.0.17763.55 x64)

I'm following this link for migrating WPF 4.7 class library Packages.config to PackageReference:

https://blog.nuget.org/20170316/NuGet-now-fully-integrated-into-MSBuild.html

I was prompted by the dialog to select between Packages.config or PackageReference. I selected PackageReference.

The article does not seem to be fulfilled because not explain how add nuget parameters like autor, pack, and out put pack.

For these reasons I added some sections in my test WPF csproj (I attach it in a zip).

  1. Added some properties extracted from a netstandard project (see ).

  2. Copy nupkg from Debug to a mapped folder (see )

But nupkg is not generated. Why? How existing NuGet packages can work if I am using PackageReference for WPF, Windows Forms or ASP.NET projects? Will VS2017 or newer support it?

@JosepBalague JosepBalague changed the title if I am using PackageReference for WPF, Windows Forms or ASP.NET projects? Will existing NuGet packages work if I am using PackageReference for WPF, Windows Forms or ASP.NET projects? Oct 12, 2018
@rrelyea rrelyea added Resolution:Question This issues appears to be a question, not a product defect Functionality:Pack labels Oct 12, 2018
@rrelyea
Copy link
Contributor

rrelyea commented Oct 12, 2018

If you do the following changes to your project, I think it will work...I at least got the basics working:

Add the following item to enable Pack target:

    <PackageReference Include="NuGet.Build.Tasks.Pack">
      <Version>4.8.0</Version>
    </PackageReference>

Delete the CopyPackageDebug and CopyPackageRelease targets

Set the following property:
<PackageOutputPath>$(MSBuildThisFileDirectory)nupkgs</PackageOutputPath>

Stop setting the BuildOutputTargetFolder property

(i tested by changing the TargetFramework to 4.6.1, since I didn't have the 4.7 targetting pack installed).

@JosepBalague
Copy link
Author

JosepBalague commented Oct 13, 2018

Thanks @rrelyea. It works fine with 4.7.0 too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Pack Resolution:Question This issues appears to be a question, not a product defect
Projects
None yet
Development

No branches or pull requests

2 participants