我在本地机器中有两个文件(*.XML&*.JSON),我想为这两个文件手动创建一个nuget包。稍后我需要在我的中导入Nuget包。Net 6 WPF应用程序。在导入过程中,我的XML文件需要放置在指定的路径上,JSON内容将由我的.net代码读取,并需要写入另一个JSON文件中。
我创建了一个nuspec文件,如下所示,并在内容文件夹中放置了一个XML和JSON文件。
当我尝试执行命令时
nuget pack Test.nuspec
使用命令提示符,我得到一个错误
''nuget' is not recognized as an internal or external command, operable program or batch file'
我的机器里有视觉工作室2022。我也尝试了PowerShell,但得到了同样的错误。
由于我是新手,有人能帮我理解我在这里的错误吗。
Test.nuspec文件:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Test</id>
<version>1.0.0</version>
<authors>MyName</authors>
<owners>MyName</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Test</description>
</metadata>
<contentFiles>
<files include="content/Test.xml" buildAction="Content" />
<files include="content/Test.json" buildAction="Content" />
</contentFiles>
</package>