NuGet how to create nuspec file - command-line

I can't find it anywhere. How do i create a nuspec file of my project (VS2013). I tried "nuget spec" command but it doesn't work. I installed nuget command line and then i tried to run nuget.exe, it just blinks and exits.
So i can't enter the command anywhere i tried to use package manager console, cmd... But nothing works.
I wanna use NuGetter to create packages after build. But it needs those nuspec files of my project.
Any ideas please? :( I'm completly lost now.
Thanks.

If you click nuget.exe it will blink and close it because it is an executable file not accepting any further input from the user.
For using nuget.exe you need to open in the command window where nuget.exe is physically stored (you can use enviroment variable also) and follow with the command
C:/> nuget spec

Related

Navigate to folder directly before i can use command in in a command line

I don't know how to search for my problem here.
In the command line i must navigate everytime directly in the folder where the software was installed.
Before I can use the command "java -v" or "flutter doctor" or what ever i must navigate to the java or flutter folder and i don't know why.
Maybe someone of you knows the ONE solution.
I use windows 11. I think it might be due to the environment variables - the environment variables entered are automatically deleted all the time.

I'm trying to use "flutterfire configure" but I'm getting an error. Can somebody have an issue for me please? [duplicate]

I'm trying to install flutterfire_cli in my root project, so I typed this command:
FirebaseFirestore firestore = FirebaseFirestore.instance;
so after that, this is the output of my console:
PS C:\Users\PC\Desktop\eventually> dart pub global activate flutterfire_cli
Package flutterfire_cli is currently active at version 0.1.1+2.
Resolving dependencies...
The package flutterfire_cli is already activated at newest available version.
To recompile executables, first run `global deactivate flutterfire_cli`.
Installed executable flutterfire.
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated flutterfire_cli 0.1.1+2.
To fix the warning I added C:\Users\PC\AppData\Local\Pub\Cache\bin to my Path in system variables environnement. (but it does not work, I'm still getting the warning)
Next, I'm trying to generate the firebase_options.dart file as the documentation says using this command:
flutterfire configure
But I'm getting an error in the console:
PS C:\Users\PC\Desktop\eventually> flutterfire configure
flutterfire : The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ flutterfire configure
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (flutterfire:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Could anyone tell me what I am missing, why I am getting this error even if the Firebase CLI already installed on my machine?
Go through this doc very carefully: https://firebase.flutter.dev/docs/cli/
Step 1: Install Firebase CLI
Step 2: Install FlutterFire CLI with this command dart pub global activate flutterfire_cli
While doing this you must notice the following warning
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path. You can fix that by adding that directory to your system's "Path" environment variable. A web search for "configure windows path" will show you how.
This means you need to add C:\Users\*username*\AppData\Local\Pub\Cache\bin into your System's environment path.
Step 3: Now flutterfire configure should work.
If still not working play with Firebase commands
For Mac -> Execute this command:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Three 3 steps for getting it work on Windows:
Run this command:
dart pub global activate flutterfire_cli
Type env into Windows search and open Edit the system environment variables --> Environment variables --> System variables( the one on the bottom of the window) --> Double click on Path --> New and enter this:
C:\Users\PutHereYourUsername\AppData\Local\Pub\Cache\bin
flutterfire configure command should work now - close and open again command prompt or other terminal. Sometimes there is a problem with other editors and terminals where flutterfire configure still does not work. In that case open Command Prompt and it works there for sure.
As for me, I have done everything correctly and the command works if I run in the Windows command prompt, but it fails to work if I type the command inside the VS code terminal.
So I just killed the terminal and opened it again, then it works.
Or, you can try restarting your machine.
Even after adding C:\Users\PC\AppData\Local\Pub\Cache\bin to the path for me flutterfire would not work from the command line, the reason being that it actually instally a flutterfire.bat file.
So I use flutterfire.bat in the command line as of now and that is working.
For Linux/Ubuntu run this command in the terminal,
export PATH="$PATH":"$HOME/.pub-cache/bin"
Which you will also notice in the terminal when you run the command ↓.
dart pub global activate flutterfire_cli
Make sure you are your project directory
run this export PATH="$PATH":"$HOME/.pub-cache/bin"
For Linux/Ubuntu you should do the following:
Open your .bashrc file using the command "sudo nano ~/.bashrc"
Add export PATH="$PATH":"$HOME/.pub-cache/bin" to the end of the file.
Final you can source the file using "source ~/.bashrc"
It should now be able to recognize the file.
for macOS Monterey edit ~/.zprofile instead .zshrc
This was the hack i used to solve mine. I copied and pasted the C:\Users\PC\AppData\Local\Pub\Cache\bin in my folder search bar to enter the folder, note I could not find any folder called AppData, but when I pasted it on the folder search it did take me to the bin folder.
In the bin folder, you will find a file called flutterfire.bat. Copy and paste the flutterfire.bat file in the root of your project and then run the .\flutterfire configure command. Please do note the dot (.) and forward-slash (\). You need to add it to work.
for mac m1 , add
export PATH="$PATH":"$HOME/.pub-cache/bin" at the top of users/username/.profile , works on (monterey)
For me, even after I installed everything correctly, restarting my IDE(VSCode) did the trick.
Flutter command not found
Here is very easy instructions for adding something to your path on Mac, It solved my issues with Flutter and Flutterfire.
The export PATH="$PATH":"$HOME/.pub-cache/bin" did not work on my Debian machine!
I removed the first line #!/usr/bin/env sh from $HOME/.pub-cache/bin/flutterfire file and the flutterfire command worked properly.
Use command prompt.. not the vsc terminal
if you followed the right answer and still not working, you need to restart your computer

powershell install Add-AppDevPackage.ps1 package fail "can not find any package"

I create UWS simple package in the visual studio 2015. Then install the package to my windows 10 virtual machine via powershell is work. I can see the app in my start menu and run it is OK.
I want to install the package to my PAD windows 10(10586.29). Copy the package folder "UWSHellowWord_1.0.1.0_Test" to the document folder. Long click the file "UWSHellowWord_1.0.1.0_Test\Add-AppDevPackage.ps1" shows a menu then choose the "use powershell execute" to install this package.
The powershell shows me an error message "Error: can not find any package or resource in the command directory. Please make sure The packages you want to install packages or resource are placed in the same directory". I don't know how to fix it. Any suggestion will be appreciated.
Run powershell (as administrator)
navigate to directory ""UWSHellowWord_1.0.1.0_Test"
Type - powershell Set-Executionpolicy RemoteSigned
Type .\Add-AppDevPackage.ps1
and check

How to open Visual Studio Code from the command line on linux?

I know I can use command "code" to open VS code or file, but I don't know what should I do to make it possible after I install VS code in Ubuntu.Thanks.
Launching from the Command Line
You can launch VS Code from the command line to quickly open a file, folder, or project. Typically, you open VS Code within the context of a folder. We find the best way to do this is to simply type:
code .
Tip: We have instructions for Mac users in our Setup topic that enable you to start VS Code from within a terminal. We add the VS Code executable to the PATH environment variable on Windows and Linux automatically during installation.
Sometimes you will want to open or create a file. If the specified files does not exist, VS Code will create them for you:
code index.html style.css readme.md
Tip: You can have as many file names as you want separated by spaces.
Source: https://code.visualstudio.com/Docs/editor/codebasics
So, there are a couple of solutions for this.
I've linked a video that shows you how to add vscode to $PATH
(which didn't work for me because I couldn't find the "shell:install path" command)
I uninstalled the vscode from my ubuntu and re-installed using sudo snap install --classic code
(This method worked for me)
Tell me which one works for you... and if you have extensions installed to your vscode then i guess you ought to make a backup or something.
Link to the video: https://youtu.be/iP5FKZXtDBs

Run powershell script at startup in visual studio

I have a powershell file (script.ps1) that is in some of my visual studio solutions. The script contains utility functions for the project.
At the moment, I just open the nugget package manager and copy and paste the content of the script and it runs fine. I can run the functions correctly from the nugget package manager. But this has to be done, each time I open the solution.
Is there a way to get this handle automatically each time I open the solutions?
Rather than copy pasting the entire thing, you can dot source the file
. ".\script.ps1"