dotnet core sdk portable
Hi
We can not install any application in our PCs for our network policies.
I downloaded "dotnet-sdk-2.2.101-win-x64" but I do not have administrator user pass for installation.
Is there a way for have dotnet core sdk or standard dot net on my pc?
I only have VS Code Portable and "dotnet new -t web" command gives error:
_dotnet : The term 'dotnet' 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._
Is there a way for create and run a dotnet or dotnetCore MVC project without installation?
I believe you can just unpack the ZIP file, set some env. vars. and run from a directory.
There also seems to be installation script for Windows: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script ... maybe it does not need admin priviledges if you do not install SharedFramework.
Standard is not something you can install. It is just spec (or think about it as interface) that .NET Core or .NET Framework (or other .NET implementations like UWP and Xamarin) implement.
Could you explain how?
I opened powershell and wrote : PS C:\Users\sap-komaei.CII> ./dotnet-install.ps1 -Channel 2.0 -InstallDir C:\cli
But give error :
./dotnet-install.ps1 : The term './dotnet-install.ps1' 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
@mammadkoma you need to download and run script "https://dot.net/v1/dotnet-install.ps1" from https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I downloaded script "https://dot.net/v1/dotnet-install.ps1"
How to run it?
For _Set-ExecutionPolisy unrestricted_ command , need to open PowerShell as administrator.
I use it in my builds(copied from .net core build repo)
function DownloadRuntime
{
set-strictmode -version 2.0
$ErrorActionPreference = "Stop"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$toolsRoot = Join-Path $PSScriptRoot "..\.tools"
Create-Directory $toolsRoot
$scriptPath = Join-Path $toolsRoot "dotnet-install.ps1"
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $scriptPath
& $toolsRoot\dotnet-install.ps1 -InstallDir $toolsRoot\dotnet -Version $dotnetsdk
}
For Set-ExecutionPolisy unrestricted command , need to open PowerShell as administrator.
Yes To change the execution policy for the default (LocalMachine) scope, start PowerShell with the "Run as administrator" option. It's a security setting.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-6
So I can not install dotnet core sdk without administrator access.
So I can not install dotnet core sdk without administrator access.
I mean, not really, with powershell you need powershell run script rights as all other scripts, but if you want you can download .net zip and unzip in some folder as non admin with custom tools. This scripts are done in powershell, the issue you are hitting is a powershell setting.
Here you can find links https://dotnet.microsoft.com/download/dotnet-core/2.2 for last zipped .net https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-2.2.101-windows-x64-binaries (.NET Core Binaries)
I downloaded _dotnet-sdk-2.2.101-win-x64.zip_ and extract it
How to use it and run dotnet?
It depends, if you don't have any .net core version installed on machine you can simply point to dotnet cli driver and run your app:
c:\dotnet\dotnet.exe yourapp.dll
If you've some .net core installed machine wide(c:\Program files...) you need to tell to dotnet.exe driver to not use global version(dotnet.exe is in path environment variable and will be resolved from program files folder) but your new downloaded version(https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?tabs=netcore21#environment-variables)
c:\>set DOTNET_MULTILEVEL_LOOKUP=0
c:\>dotnet\dotnet.exe yourapp.dll
I don't have any .net core version installed on machine. And I can not install anything.
I just downloaded _VS Code portable_ and dotnet-sdk-2.2.101-win-x64 _Zip File_.
How to create a MVC project by these?
dotnet command is not recognized in powershell and vs code.
I don't use VS Code, here some infos https://code.visualstudio.com/docs/other/dotnet
When I double clicked on dotnet.exe a command prompt open and close very fast.
And dotnet.exe not execute by powershell.

dotnet : The term 'dotnet' 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
In powershell .\dotnet.exe --info
On double click it's correct...open and close windows, why would stay open?
I suggest to try with documentation sample https://dotnet.microsoft.com/learn to understand how .net core works, it's different from .net full framework if you come from there.
oooooh
_.\dotnet.exe new mvc_ created a project.
Thank you
But this project is near dotnet.exe.
How to create project in a new folder and build and run in new folder?
You need use full path driver name(dotnet.exe) i.e.
c:\dotnet\dotnet.exe
c:\mywebsite
...
c:\mywebsite>c:\dotnet\dotnet.exe new mvc
Thank you
Now VS Code portable terminal can run my project by _PS C:\MVC> c:\dotnet\dotnet.exe run_ command.
glad to hear, happy coding!
dotnet-sdk-2.2.101-win-x64.zip
Where?
@Lukasavicus check out these links: https://github.com/dotnet/core#net-core-releases-and-daily-builds
https://code.dblock.org/2019/12/17/dotnet-on-mac-osx-without-admin-privileges.html could be helpful for developers
Most helpful comment
You need use full path driver name(dotnet.exe) i.e.