I'm writing a deploying app to take my DLL's and create .nuspec files for each, package them, and push out to Artifactory.
Trying to use command line in c# to do this.
The problem I'm having is that the DLL's are on a network drive, and calling nuget spec command on the file location uses the full file path as the PackageID which contains invalid characters when trying to pack.
using (Process myProcess = new Process())
{
var file = @"\\network-drive\Network-Folder\MyDLLs\Test.dll";
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.FileName = "CMD.exe";
myProcess.StartInfo.Arguments = string.Format("/c nuget spec \"{0}\"", file);
myProcess.StartInfo.CreateNoWindow = false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
myProcess.Start();
myProcess.WaitForExit();
}
this results in
<?xml version="1.0"?>
<package >
<metadata>
<id>\\network-drive\Network-Folder\MyDLLs\Test.dll</id>
<version>1.0.0</version>
....
How can I specify the packageID to something like My.TestDLL?
I tried doing something like
nuget spec My.TestDLL -AssemblyPath \\network-drive\Network-Folder\MyDLLs\Test.dll
But have no idea where the nuspec file went as it was not in the directory.