Category Archives: ASP.NET
Videos from Microsoft
Freeware library to create Excel files
How to enable TLS 1.2 on Windows Server 2008 R2
Problem
How to enable TLS 1.2 on Windows Server 2008 R2?
Resolution
QuoVadis recommends enabling and using the TLS 1.2 protocol on your server. TLS 1.2 has improvements over previous versions of the TLS and SSL protocol which will improve your level of security. By default, Windows Server 2008 R2 does not have this feature enabled. This KB article will describe the process to enable this.
- Start the registry editor by clicking on Start and Run. Type in “regedit” into the Run field (without quotations).
- Highlight Computer at the top of the registry tree. Backup the registry first by clicking on File and then on Export. Select a file location to save the registry file.
- Browse to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols - Right click on the Protocols folder and select New and then Key from the drop-down menu. This will create new folder. Rename this folder to TLS 1.2.
- Right click on the TLS 1.2 key and add two new keys underneath it.
- Rename the two new keys as:
- Client
- Server
- Right click on the Client key and select New and then DWORD (32-bit) Value from the drop-down list.
- Rename the DWORD to DisabledByDefault.
- Right-click the name DisabledByDefault and select Modify… from the drop-down menu.
- Ensure that the Value data field is set to 0 and the Base is Hexadecimal. Click on OK.
- Create another DWORD for the Client key as you did in Step 7.
- Rename this second DWORD to Enabled.
- Right-click the name Enabled and select Modify… from the drop-down menu.
- Ensure that the Value data field is set to 1 and the Base is Hexadecimal. Click on OK.
- Repeat steps 7 to 14 for the Server key (by creating two DWORDs, DisabledByDefault and Enabled, and their values underneath the Server key).
- Reboot the server.
Your server should now support TLS 1.2.
Inspect your http requests with HttpLogger
A Few Great Ways to Consume RESTful API in C#
https://www.codeproject.com/Articles/1190592/A-Few-Great-Ways-to-Consume-RESTful-API-in-Csharp
How to install .Net Core on Ubuntu 16.04
Add the dotnet apt-get feed
In order to install .NET Core on Ubuntu, you need to first set up the apt-get feed that hosts the package you need.
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 sudo apt-get update
Install .NET Core SDK
Before you start, please remove any previous versions of .NET Core from your system by using this script.
sudo apt-get install dotnet-dev-1.0.0-preview2-003121
Initialize some code
Let’s initialize a sample Hello World application!
mkdir hwapp cd hwapp dotnet new
Run the app
The first command will restore the packages specified in the project.json file, and the second command will run the actual sample:
dotnet restore dotnet run
And you’re ready!
You now have .NET core running on your machine!
Source: .Net Core on Ubuntu
HTTP Error 503. The service is unavailable
I recently had a problem with IIS on Windows 7 where trying to access http://localhost on the default port 80 was giving me an error:
“HTTP Error 503. The service is unavailable”
I spent several hours trying to find the cause and trying different things without any success.
Finally I came across this post that helped me resolve the problem.
The root cause was an URL Reservation http://+:80/
To remove the reservation type the following in a command prompt (but first read the post to know what your are doing):
netsh http delete urlacl http://+:80/
log4net contextual properties and ASP.NET
I just found this article that helped me to find the answer about the weird results with my log files produced by ASP.NET application:
log4net contextual properties and ASP.NET
Big thank you to the author!