-
Notifications
You must be signed in to change notification settings - Fork 249
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
PackagePath is treated as a directory, not a file path, for files with no extension [Regression] #6351
Comments
@rohit21agrawal can you take a look to see what caused this? |
this is caused as a side-effect of fixing : #5898 I believe the fix is correct actually as it fixes a scenario that couldn't be worked around before. The scenario you mentioned can easily be fixed by including an empty packagePath:
or
|
We are hitting NuGet/Home#6351, which was resolved as a by-design change so we need to adjust to handle it. Paths for filenames that don't have extensions turned into <filename>\<filename> as the file got appended to it. Without an extension nuget assumes the target path is a directory, for better or worse.
We are hitting NuGet/Home#6351, which was resolved as a by-design change so we need to adjust to handle it. Paths for filenames that don't have extensions turned into <filename>\<filename> as the file got appended to it. Without an extension nuget assumes the target path is a directory, for better or worse.
We are hitting NuGet/Home#6351, which was resolved as a by-design change so we need to adjust to handle it. Paths for filenames that don't have extensions turned into <filename>\<filename> as the file got appended to it. Without an extension nuget assumes the target path is a directory, for better or worse.
We are hitting NuGet/Home#6351, which was resolved as a by-design change so we need to adjust to handle it. Paths for filenames that don't have extensions turned into <filename>\<filename> as the file got appended to it. Without an extension nuget assumes the target path is a directory, for better or worse.
@rohit21agrawal, @emgarten, I would greatly appreciate your thoughts and suggestions on handling this change in an open-source project not pinned to an SDK version. We were going back and forth with an extra level of patch spec appearing in packages, before I finally realized that I used the latest SDK 2.1.403, but the gRPC CI, which builds packages, apparently has an earlier version. This behavior has actually changed from the SDK version 2.1.4 to 2.1.100, shipped with the respective NuGet.Build.Tasks.Pack.dll versions 4.5.0.4 and 4.6.0.0. My understanding is that .NET Core 2.0 is EOL, which means it's ok for us to pretend there are no SDK versions between 2.0.0 and up to but not including 2.1.300; these should just be upgraded by the user. This is good news, since the breaking change falls into this dead range. The SDK versions 1.0 and 1.1 are alive and supported, though. This means that supported SDK versions that exhibit the ante-fix ("old") behavior are all below 2.x.x, and the SDK 2.1.300 (the earliest in the Core 2.1 line) and above come with this fix ("new" behavior). Now, it is fairly easy to find out which one we are being packaged under, because the SDK 2.1.300 and later set the property Am I making sense, and am I not falling into a possible trap? So far I have been assuming that the NuGet.Build.Tasks.Pack is firmly tied to an SDK release, so it is not possible that the user of an 1.x SDK will have the N.B.T.P somehow upgraded it to a version with the "new", post-fix behavior (except through an unsupported kluge). Is this assumption correct/reasonable? X-ref grpc/grpc#13207 |
I've run into this problem as well, in a slightly different way. I have a file called
... but that creates a file called It looks like I'm going to have to either rename the file (which is annoying for other reasons) or copy it to |
I'm using For reference and context, the entire item group in my .csproj looks like <ItemGroup>
<None Update="NativeArtifacts\*"
Link="%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest"
Pack="true" PackagePath="contentFiles\%(Filename)%(Extension);content\%(Filename)%(Extension)" PackageCopyToOutput="true" />
<None Include="..\LICENSE" Pack="true" PackagePath=""/>
</ItemGroup> The |
GenerateNuspec changed the way it handles PackagePath in a recently nightly.
Details
NuGet product used: dotnet
NuGet version (x.x.x.xxx): ?
dotnet.exe --version: 2.2.0-preview1-007846
OS: Windows 10
Worked before? Yes, in dotnet.exe 2.2.0-preview1-007796
Repro
dotnet pack
this projectExpected
Package layout in the 2.1.3 SDK and previous nightlies was:
Actual
With the 2.2.0-preview1-007846 SDK, layout adds a folder for the prefercliruntime file.
The text was updated successfully, but these errors were encountered: