-
Notifications
You must be signed in to change notification settings - Fork 55
dotnet pack pdb files by default #291
Conversation
by adding .pdb to AllowedOutputExtensionsInPackageBuildOutputFolder
This isn't working for me with my tests just now here: Some notes: <AllowedOutputExtensionsInPackageBuildOutputFolder>.dll; .exe; .winmd; .json; .pri; .xml; $(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder> |
Using the structured log viewer, I see that nothing I do in the NuGet-imported .props and .targets seems to have any effect on the Pack MSBuild invocation. It affects all the invocations that Pack depends on, but not Pack itself. @nguerrera Are you able to give us some pointers on how to manipulate the Pack target from .props imported from NuGet packages? Thanks! |
I see this if I preprocess the .csproj: <ImportGroup Condition=" '$(TargetFramework)' == 'net461' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b626\build\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b626\build\SourceLink.Embed.PaketFiles.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b626\build\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b626\build\SourceLink.Embed.PaketFiles.props')" />
</ImportGroup> That means the .props is not imported from the NuGet package unless there is a |
Thanks @jnm2, I troubleshot this today with ctaggart/sourcelink-test@3a8feea and you are indeed correct. It is working with It currently produces: <ImportGroup Condition=" '$(TargetFramework)' == 'net461' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props')" />
<Import Project="$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props')" />
<Import Project="$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props')" />
</ImportGroup> If it also added a condition for when <ImportGroup Condition=" '$(TargetFramework)' == '' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props')" />
<Import Project="$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props')" />
</ImportGroup> |
Yes. Even better: <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b631\build\SourceLink.Embed.PaketFiles.props')" />
<Import Project="$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b631\build\SourceLink.Create.CommandLine.props')" />
</ImportGroup> And only use |
Could you open an issue at https://github.com/dotnet/sdk, maybe? |
I'll open up an issue in https://github.com/NuGet/Home. I think that is the right spot. |
Yay, <ImportGroup Condition=" '$(TargetFramework)' == '' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b637\buildCrossTargeting\SourceLink.Embed.PaketFiles.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.embed.paketfiles\2.7.0-b637\buildCrossTargeting\SourceLink.Embed.PaketFiles.props')" />
<Import Project="$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b637\buildCrossTargeting\SourceLink.Create.CommandLine.props" Condition="Exists('$(NuGetPackageRoot)sourcelink.create.commandline\2.7.0-b637\buildCrossTargeting\SourceLink.Create.CommandLine.props')" />
</ImportGroup> |
Nice to know! I'm embarrassed that I forgot that existed. 😆 |
ctaggart's SourceLink has at some point started packing `.pdb` files into the main Nuget package, which is not ideal if we want to publish a separate `.snupkg` to NuGet. For that reason, let's make the switch to `dotnet/SourceLink` even though it is *still* only in beta. References: * ctaggart/SourceLink#291
ctaggart's SourceLink has at some point started packing `.pdb` files into the main Nuget package, which is not ideal if we want to publish a separate `.snupkg` to NuGet. For that reason, let's make the switch to `dotnet/SourceLink` even though it is *still* only in beta. References: * ctaggart/SourceLink#291
ctaggart's SourceLink has at some point started packing `.pdb` files into the main Nuget package, which is not ideal if we want to publish a separate `.snupkg` to NuGet. For that reason, let's make the switch to `dotnet/SourceLink` even though it is *still* only in beta. References: * ctaggart/SourceLink#291
by adding .pdb to AllowedOutputExtensionsInPackageBuildOutputFolder #282
Related links:
dotnet pack
andmsbuild /t:pack
do not include the pdb files by default. As of Visual Studio 2017 15.4 or .NET Core 2.0.2 SDK and above, you can fix this by modifying this property:We may automatically set that property in the next version of SourceLink, see issue #282.
The previous recommended way of including them was to use the extension point designed for including content that is different for each target framework: