Skip to content

Files from nuget package not copied to the build output #474

Answered by reduckted
aglasencnik asked this question in Q&A
Discussion options

You must be logged in to vote

There is a way that you can do this without needing to manually copy files from the NuGet package.

On the PackageReference element, you can set GeneratePathProperty to true. That will create a property with the path to the NuGet package.

<PackageReference Include="EmmetNetSharp" Version="1.0.0" GeneratePathProperty="true"/>

In this instance, the property will be called PkgEmmetNetSharp (you can look in the obj/*.nuget.g.props file to confirm the name).

You can then use that property to include the files from the NuGet package. For example, if you want to include the files in the VSIX file, you can do this:

<ItemGroup>
  <Content Include="$(PkgEmmetNetSharp)\content\Scripts\*.js" IncludeIn…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@madskristensen
Comment options

@madskristensen
Comment options

@aglasencnik
Comment options

@madskristensen
Comment options

@aglasencnik
Comment options

Comment options

You must be logged in to vote
1 reply
@aglasencnik
Comment options

Answer selected by aglasencnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants