dotnetcore
building from source
References are in /eng, check building from source.
accessing configuration in test projects
endpoint configuration
Specify URLs using ASPNETCORE_URLS environment variable or --urls command-line argument.
installing dotnet core sdk on linux
package manager
scripted install
bash
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 8.0
Then set the following ~/.profile:
bash
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
installing dotnet core
Powershell
php
# install dotnet core sdk
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1
.\dotnet-install.ps1 -Channel LTS -InstallDir 'C:\Program Files\dotnet'
To do the same but from a nightly (master) use --Channel master.
bash
.\dotnet-install.ps1 -Channel master -InstallDir 'C:\Program Files\dotnet'
Installing the runtime only
bash
.\dotnet-install.ps1 -Version 3.0.0-preview9-19410-12 -Runtime dotnet -InstallDir 'C:\Program Files\dotnet'
More info on dotnet-install.ps1.
Bash
bash
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel LTS # install the latest LTS
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 6.0.418 # install a specific version
Update PATH:
bash
export PATH=$PATH:$HOME/.dotnet
May also need DOTNET_ROOT=$HOME/.dotnet:
blocking urls in selenium
Sometimes we want to block specific URLs from loading, for example Google Analytics so we don’t artificially inflate our statistics.
csharp
readonly string[] _blockUrls = new [] {
"www.google-analytics.com"
};
public ChromeDriver GetDriver()
{
var options = new ChromeOptions();
var rules = string.Join(',', _blockUrls.Select(r => $"MAP {r} 127.0.0.1"));
options.AddArgument($"--host-resolver-rules={rules}");
return new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);
} selenium packages for dotnet core
Selenium.WebDriver
Selenium.WebDriver.ChromeDriver
Selenium.Chrome.WebDriver - for moving chromedriver.exe into bin
DotNetSeleniumExtras.WaitHelpers - for ExpectedConditions
Selenium PageFactory deprecated for .NET Core
See alternate implementation here.
posts
- Writing code the easy way with TDD
- Local .NET Development with Amazon S3
- Using Secret Manager in .NET Console Apps
- Browser Fingerprinting and Concealing Selenium
- This Social Image was Generated
- Service and Container Orchestration for .NET with Tye
- Monitoring the Web with Azure for Free
- Load testing ASP.NET Core SignalR
- Deploying ASP.NET 5 projects to MyGet
- ASP.NET 5 on the Amazon (Linux) Cloud
- Gnashing of Teeth on the Bleeding Edge
- Migrating to ASP.NET 5
- .NET Development on Linux
