Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to create Nuget Package manually and import it in .Net 6 project

$
0
0

I have two files (*.XML & *.JSON) in my local machine and I want to create a nuget package manually for those two files. Later I need to import that Nuget package in my .Net 6 WPF application. During import, my XML file needs to be placed on the specified path and JSON content will be read by my .net code and needs to be written inside another JSON file.

I have created a nuspec file as below and placed an XML and JSON file inside the content folder.When I try to execute the command nuget pack Test.nuspec using command prompt, I am getting an error ''nuget' is not recognized as an internal or external command, operable program or batch file'

I have visual studio 2022 in my machine. I tried with PowerShell also but getting same error.As I am new to nuget package generation, can someone help me to understand my mistake here.

Test.nuspec file:

<?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>

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>