Answered by:
Blazor, nuget package manager grayed out

Question
-
User2110873642 posted
i created a Blazor serverside project. and the nuget package manager is grayed out and disabled. installing it trough the Terminal does also not work.
without it i cant install the nuget package for Livesharp
Tuesday, July 21, 2020 5:23 PM
Answers
-
User475983607 posted
I'm not sure why you are unable to work with the package manager.... I do not have this problem is a Blazor project.
Anyway, I use the standard watch switch which creates a file watcher where every time a file is saved the application is compiled.
cd "path/to/the/project"
dotnet watch runI find it very convenient as any errors and standard logging is written to the console or power shell while running the project.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, July 21, 2020 5:55 PM
All replies
-
User475983607 posted
I'm not sure why you are unable to work with the package manager.... I do not have this problem is a Blazor project.
Anyway, I use the standard watch switch which creates a file watcher where every time a file is saved the application is compiled.
cd "path/to/the/project"
dotnet watch runI find it very convenient as any errors and standard logging is written to the console or power shell while running the project.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, July 21, 2020 5:55 PM -
User2110873642 posted
im trying it now
Tuesday, July 21, 2020 6:00 PM -
User2110873642 posted
C:\Program Files\dotnet\sdk\5.0.100-preview.6.20318.15\Microsoft.Common.CurrentVersion.targets(4651,5): error MSB3027:
Could not copy "C:\Users\fazio\source\repos\SimmiePixel\SimmiePixel\obj\Debug\netcoreapp3.1\SimmiePixel.exe" to "bin\De
bug\netcoreapp3.1\SimmiePixel.exe". Exceeded retry count of 10. Failed. [C:\Users\fazio\source\repos\SimmiePixel\Simmi
ePixel\SimmiePixel.csproj]
C:\Program Files\dotnet\sdk\5.0.100-preview.6.20318.15\Microsoft.Common.CurrentVersion.targets(4651,5): error MSB3021:
Unable to copy file "C:\Users\fazio\source\repos\SimmiePixel\SimmiePixel\obj\Debug\netcoreapp3.1\SimmiePixel.exe" to "b
in\Debug\netcoreapp3.1\SimmiePixel.exe". The process cannot access the file 'C:\Users\fazio\source\repos\SimmiePixel\Si
mmiePixel\bin\Debug\netcoreapp3.1\SimmiePixel.exe' because it is being used by another process. [C:\Users\fazio\source\
repos\SimmiePixel\SimmiePixel\SimmiePixel.csproj]
The build failed. Fix the build errors and run again.
watch : Exited with error code 1
watch : Waiting for a file to change before restarting dotnet...
watch : Started</div>Tuesday, July 21, 2020 6:07 PM -
User475983607 posted
Make sure you are running as an admin. This error "Unable to copy" usually means the app is already running and there is a file lock or there was a compiler error in a shared library.
Anyway, I've used the technique for several years and verified it works in both Blazor Server and Blazor WASM.
Tuesday, July 21, 2020 6:26 PM -
User2110873642 posted
when i run as administrator i see even more errors.
the same copy error, and then also a cant use this port a second time error.
Tuesday, July 21, 2020 6:37 PM -
User475983607 posted
when i run as administrator i see even more errors.
the same copy error, and then also a cant use this port a second time error.
This is not rocket science. The port error means the port is already in use by another process. I assume the same process is locking the bin folder. Try restarting you computer or stopping the offending application.
Tuesday, July 21, 2020 6:41 PM -
User475983607 posted
Also, the default ports are 5000 and 5001 when running under kestrel. The ports can be changed by updating the launchSettings.json file found in the Properties folder within solution explorer.
"BlazorServerDemo": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:6001;http://localhost:6000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }
.Tuesday, July 21, 2020 7:23 PM -
User2110873642 posted
its solved now.
the problem was that i clicked the Debug button. not knowing that it shouldnt be run when doing 'dotnet watch run'.
i thought that 'dotnet watch run' would update the debugger. but it completely replaces the debugger :)
Tuesday, July 21, 2020 10:47 PM -
User475983607 posted
its solved now.
the problem was that i clicked the Debug button. not knowing that it shouldnt be run when doing 'dotnet watch run'.
i thought that 'dotnet watch run' would update the debugger. but it completely replaces the debugger :)
I rarely use the debugger and prefer to output logging and errors to the console during run-time. It takes a bit to become comfortable with this approach. I like it because it's a similar approach I used in embedded programming which I did for many years. Debuggers are great but they make ya dumb and dependent, IMHO. Although I do use the debugger when I'm really stuck.
Tuesday, July 21, 2020 11:01 PM -
User2110873642 posted
meh, it does not make you dumb. it depends on the job at hand. over time you would debug less often anyhow, because you wont make mistakes after getting used to your own coding signature.
I often work with 3D dimensional indexing. i like to debug it to some graphical helper html, the console can only output it in 2D.
Wednesday, July 22, 2020 1:03 AM