简体   繁体   中英

How can I embed / reference .NET references in a NuGet package?

I have a .net resource library which contains some nuget packages as well as some default .net references:

  • NLog (nuget)
  • Microsoft.Expression.Drawing (.net reference)
  • System.Windows.Interactivity (.net reference)

If I build my nuget package

nuget pack -Prop Configuration=Release -OutputDirectory nuget %SOLUTION%\\%SOLUTION%\\%SOLUTION%.csproj

and install it afterwards in a wpf project, the two .net references where not installed.

Is there a solution to automatically install the .net references?

As bradbury mentioned, I haved created a *.nuspec file and added all framework assemblies into it.

To automatically add these items to the nuspec without thinking about it, I have extended my personal nugetLib with a new function.

Now I have just a 1 liner in my ci script:

    # add framework assembly dependencies into the nuspec file
    - nugetlib frameworkassemblies -c %SOLUTION%\%SOLUTION%\%SOLUTION%.csproj -n %SOLUTION%\%SOLUTION%\%SOLUTION%.nuspec -p %SOLUTION%\%SOLUTION%\packages.config

Source: https://github.com/dojo90/nugetLib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM