I have a very simple test library and I want to pack it into a nuget package. It works fine. Dependencies are added. But Framework Assembly References aren't, so I added manually:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>TestDLL2</id>
<version>1.0.0</version>
<title>TestDLL2</title>
<authors>Oscar Rodríguez</authors>
<owners></owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Librería de Prueba OR-Apps.</description>
<copyright>Copyright © 2023</copyright>
<dependencies>
<group targetFramework=".NETFramework4.8">
<dependency id="ini-parser" version="2.5.2" />
<dependency id="InputSimulatorPlus" version="1.0.7" />
<dependency id="WpfAnimatedGif" version="2.0.2" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="PresentationFramework.Classic" targetFramework=".NETFramework4.5" />
<frameworkAssembly assemblyName="System.Deployment" targetFramework="" />
</frameworkAssemblies>
</metadata>
</package>
Main problem: when I install the package in a project, only some references are added, but not all. In the previous sample "PresentationFramework.Classic" is added but "System.Deployment" isn't.
I tried with different references but not luck. Any idea?
I finally got it working. I forced "targetFramework" with a content:
<frameworkAssemblies>
<frameworkAssembly assemblyName="PresentationFramework.Classic" targetFramework=".NETFramework4.8" />
<frameworkAssembly assemblyName="System.Deployment" targetFramework=".NETFramework4.8" />
</frameworkAssemblies>