question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet build not including .dep files in build output

See original GitHub issue

We are using a nuget package which has it dependencies bundled up as a .dep file, when we run dotnet build, the .dep file is not included in out outputted bin file. (This used to work with dnx)

Steps to reproduce

Create a new netcore project (class library will be fine) set framework to net4xx as this library doesn’t have an option for core yet

SAMPLE Project.json { "version": "1.0.0-*", "dependencies": { "hiqpdf.free": "9.21.0" }, "frameworks": { "net461":{} } } once package restore has completed, run dotnet build

Expected behavior

Expected the packages .dep file to be in the bin

Actual behavior

.dep file is not included in bin

I have also tried to force it using: "buildOptions": { "embed": "**/*.dep" }

Environment data

dotnet --info output: .NET Command Line Tools (1.0.0-preview2-003121)

Product Information: Version: 1.0.0-preview2-003121 Commit SHA-1 hash: 1e9d529bc5

Runtime Environment: OS Name: Windows OS Version: 10.0.10586 OS Platform: Windows RID: win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danielmarcotocommented, Nov 2, 2021

I know this topic is outdated but I would like to share my solution in order to help someone that was struggling with it.

The project that uses SDK-style need to declare the files to be copied to output folder (bin as default). So, here is the snippet. I set the boolean property GeneratePathProperty to true and I made use of the variable $(Pkghiqpdf) for finding the path baseline. This is composed by the prefix Pkg + package name as it is in Include attribute (replace periods by underscores).

<ItemGroup>
     <PackageReference Include="hiqpdf" Version="10.15.0" GeneratePathProperty="true" />
</ItemGroup>
<Target Name="CopyHiqpdfFiles" AfterTargets="Build">
    <Copy SourceFiles="$(Pkghiqpdf)\lib\net40\HiQPdf.dep" DestinationFolder="$(OutDir)" />
    <Copy SourceFiles="$(Pkghiqpdf)\lib\net40\HiQPdf.rda" DestinationFolder="$(OutDir)" />
</Target>
0reactions
primalfearcommented, Jul 28, 2016

Thanks, i will contact the package vendor

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .NET Core 2.0 Build not including dependencies
How do I build the project where it includes all the dependencies in the output files? I've published the project with Visual Studio...
Read more >
dotnet build command - .NET CLI
Description. The dotnet build command builds the project and its dependencies into a set of binaries. The binaries include the project's code ...
Read more >
.NET Core SDK Projects: Controlling Output Folders and ...
In Markdown Monster Addins compile into a non-standard folder in the main EXE's output folder, so when building the project I want my...
Read more >
Copy files from the NuGet package to the destination ...
It creates some references for folders, not real folders. There are no physical files created in the modules folder in the destination project....
Read more >
How to stop references being copied to output directory ...
When using dotnet build on the My.Assembly project, the Private assemblies are always copied to the /external/ folder (resulting in multiple ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found