简体   繁体   English

如何在NuGet包中嵌入/引用.NET引用?

[英]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: 我有一个.net资源库,其中包含一些nuget包以及一些默认的.net引用:

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

If I build my nuget package 如果我构建我的nuget包

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. 然后将其安装在wpf项目中,这两个.net引用未安装。

Is there a solution to automatically install the .net references? 是否有解决方案来自动安装.net引用?

As bradbury mentioned, I haved created a *.nuspec file and added all framework assemblies into it. 正如bradbury所述,我已经创建了一个* .nuspec文件并将所有framework assemblies添加到其中。

To automatically add these items to the nuspec without thinking about it, I have extended my personal nugetLib with a new function. 为了自动将这些项目添加到nuspec中,而无需考虑它,我使用新功能扩展了我的个人nugetLib

Now I have just a 1 liner in my ci script: 现在我的ci脚本中只有1个班轮:

    # 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 资料来源: https : //github.com/dojo90/nugetLib

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何才能将.NET Core程序的入口点放在它引用的NuGet包中 - How can I have the entry point to a .NET Core program be in a NuGet package it references 嵌入vs引用我的依赖项:.NET / NuGet包的最佳实践? - Embed vs reference my dependencies: Best practices for .NET/NuGet package? 如何将nuget包.Net Standard嵌入到项目C#中? - How to embed nuget package .Net Standard into a project C#? 如何为 nuget 包构建具有多个 .net 框架的项目 - How can I build a project with multiple .net frameworks for nuget package 引用 a.Net Core 3.1 NuGet package 的 a.Net 5 Visual Studio 项目/解决方案如何编译成功? - How can a .Net 5 Visual Studio Project / Solution that reference a .Net Core 3.1 NuGet package compile successfuly? 如何为解决方案中的每个项目创建单独的 nuget 包,并将项目引用转换为 nuget 依赖项? - How do I create an individual nuget package for each project in a solution, with project references converted to nuget dependencies? 如何在 .csproj 中引用 NuGet 包 - How to reference NuGet package in .csproj 解决nuget包引用 - Resolving nuget package references 如何以编程方式找到 nuget 包安装文件夹? (.NET Core - 跨平台) - How can I find nuget package installation folder programmaticaly ? (.NET Core - Cross Platform) 如何在自定义NuGet包中为不同版本的.NET框架指定不同的依赖项? - How can I specify different dependencies for different versions of the .NET framework in a custom NuGet package?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM