I create a nuget package for .Net 8 as well as with .Net Framework 4.7.2 containing .cs
files only. When installing the package with old .Net project, NuGet copies the content into the project folder, and changes csproj
file. Is it possible just to reference the files from the nuget cache like PackageReference
does? Here's my nuspec
file:
<?xml version="1.0"?>
<package>
<metadata minClientVersion="3.3.0">
<id>MyClient</id>
<version>1.0.0</version>
<authors>me</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>description</description>
<tags>myclient</tags>
<dependencies>
<group targetFramework="net8.0">
...
</group>
<group targetFramework="net472">
...
</group>
</dependencies>
<!-- Build actions for items in the contentFiles folder -->
<contentFiles>
<files include="cs/**/*.*" buildAction="Compile" />
</contentFiles>
</metadata>
<files>
<!-- this is for the new format -->
<file src="myproject/MyClient.cs" target="contentFiles\cs\any\Client" />
<!-- this is for the old format -->
<file src="myproject/MyClient.cs" target="content\Client" />
</files>
</package>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745609335a4635855.html
评论列表(0条)