-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
NuGetizer v0.9.1 packing reference assembly instead of real assembly #263
Comments
Does this work as expected if you use the built-in SDK Pack instead? |
Using Removing NuGetizer from the project results in a package that doesn't contain any of the referenced assemblies. That would be fine for a package that was going to be referenced from another project; but I'm using this to build a Squirrel.Windows package for distribution, which needs to contain all of the assemblies. As a workaround, I had to create an explicit
|
Oh no, that's the worst, nuspec should die for good ;). NuGetizer provides advanced extensibility via MSBuild so you never need to do that, however challenging your scenario might seem. Check the advanced scenarios in the readme. In particular, pulling arbitrary files from package references should totally solve your issue (while I investigate how to properly solve it). See https://github.com/devlooped/nugetizer/#packing-arbitrary-files-from-referenced-packages A combination of Pack=false on the reference plus explicit packing if the files your want, should fix it. |
This seems to produce the correct output:
However, VS2022 now shows Have I missed something? |
Just add Visible=false to the item (that's just how VS/MSBuild works by default): <PackageFile Include="lib/net461/System.Buffers.dll"
PackagePath="lib/net48/System.Buffers.dll"
PackageReference="System.Buffers"
Visible="false" /> |
BTW, you can simplify nugetizer reference to just |
Found the root cause! dotnet/msbuild#3069 |
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
Describe the Bug
I have a .NET Framework 4.8 project using NuGetizer 0.9.1 which is set up to generate a package on the release build.
Since upgrading to VS2022 v17.4, the generated package contains the reference assembly version of
System.Buffers
, despite the project having an explicit reference to that package.Steps to Reproduce
Create a new console application. Add references to
System.Memory
,System.Buffers
, andNuGetizer
. Set the package ID and the "generate package on build" flag.Build the project.
Open the generated
nupkg
file in NuGet Package Explorer.Extract
lib/net48/System.Buffers.dll
from the file.Observe that the file is the reference assembly, not the real assembly. Specifically, the reference assembly is 15Kb whereas the real assembly is 21Kb. If you open the file with a decompiler, you will see there are no bodies defined for any methods or properties.
Expected Behavior
The generated
nupkg
file should contain the real assembly.Version Info
NuGetizer v0.9.1 (latest stable)
VS2022 v17.4.1
Additional Info
The same project generated the correct package in VS v17.3.x
The text was updated successfully, but these errors were encountered: