Skip to main content

dotnet

Run a Precompiled .NET Core Azure Function in a Container
·651 words·4 mins
azure dotnet docker azure functions serverless
So this morning I found my self browsing through the images Microsoft has published in the Docker Hub and then I saw this one: microsoft/azure-functions-runtime and decided to Run a Precompiled .NET Core Azure Function in a Container. Prerequisites: Docker installed and basic knowledge. .NET Core Create a .NET Core lib project # Create a .NET Core lib project.
Prepare a .Net Core Console App for Docker
·248 words·2 mins
dotnet docker
Last week I had the luck to attend the Microsoft Azure OpenHack in Amsterdam. We spent two and a half days learning a lot about kubernetes, Azure Container Services, Azure Container Registry, Azure OMS and Minecraft! In one of the challenges we decided to implement a sidecar container for logging purposes. So using .NET Core we created a console application with proper handling of the"Control+C" and"Control+Break" key shortcuts.
.NET Core CLI and MSBUILD Cheat Sheet
·320 words·2 mins
dotnet cheat sheet
This is a small .NET Core CLI and MSBUILD Cheat Sheet with the list of commands and settings I use almost on daily basis when working with .NET Core, the command line and Visual Studio Code. Checks # Check installed CLI version: # dotnet --version Show available templates: # dotnet new Solutions # Create a solution with the name of current the folder: # dotnet new sln Create a solution with a specific name: # dotnet new sln --name [solution name] Add a project to a solution: # dotnet add sln [relative path to csproj file] Packages # Add package reference to the project in the current folder: # dotnet add package [package name] Remove a package reference from the project in the current folder: # dotnet remove package [package name] Add a specific package version reference to the project in the current folder: # dotnet add package [package name]-v [version] Restore packages: # dotnet restore Create a nuget package for the project in current folder: # dotnet pack Project Templates # Install a new project template: # dotnet new --install [dotnet template name] Remove a project template: # dotnet new --uninstall [dotnet template name] Run test defined in current folder project # dotnet test Builds # Build current’s folder solution or project # dotnet build Build current’s folder solution or project with release configuration # dotnet build -c Release Publish artifacts for current’s folder solution or project. # dotnet publish MSBUILD # To add a reference to a local assembly without nuget package, edit your csproj and add a Reference as shown in the following sample: # <code> <ItemGroup> <Reference Include="[Relative path to the Assembly dll file]" /> </ItemGroup> </code> Force a file to be copied to the output folder, edit your csproj and add a Content section as shown in the following sample: # <code> <ItemGroup> <Content Include="[name of the file]"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> </ItemGroup> </code> Hope it helps!
Toggle Raspberry Pi GPIO Pins with ASP.NET Core 2.0
·298 words·2 mins
dotnet aspnetcore raspberry pi
Today I’ll show you how to Toggle Raspberry Pi GPIO Pins with ASP.NET Core 2.0. First be aware of the following prerequisites: .NET Core 2.0 SDK A Raspberry Pi 3 Running Raspbian Install linux dependencies: sudo apt-get install curl libunwind8 gettext Now let’s start: Create a folder for your new project # Open a command prompt an run:
.NET Core, Code Analysis and StyleCop
·511 words·3 mins
dotnet static analysis
So now that .NET Core and .NET Standard 2.0 have been released some of you may be migrating applications or even creating new ones with it. As you progress you are starting to worry about the quality of your code so what you want is to at least check your code against design and style guidelines don’t you?
Step by step: .Net Core and Azure Search
·813 words·4 mins
azure dotnet azure search
Step by step: .Net Core and Azure Search is small introduction on how to connect to Azure Search, create and delete indexes, models, add documents and perform basic queries. Let’s go for it: Create an Azure Search service # Create an Azure Search service in your Azure subscription, and get the Azure Search name and primary Read-Write key.
Read Azure Service Health Activity Logs with .NET Core
·520 words·3 mins
azure dotnet azure monitor log analytics
This week there was a small outage within the Azure Data Lake Store service and as consequence I wondered how could I Read Azure Service Health Activity Logs with .NET Core. Let’s go for it: Create a folder for your new project # Open a command promt an run:
Run ASP.NET Core on OpenShift
·443 words·3 mins
dotnet aspnetcore docker openshift
Today I’ll show you how to Run ASP.NET Core on OpenShift. First be aware of the following prerequisites: You’ll need a working Docker installation. If you are using Windows 10 you can get Docker for Windows here. Be sure to Disable TLS for 127.0.0.1:2375 for your Docker installation Be sure to set 172.30.0.0/16 as an Insecure Registry in your Docker installation Be sure to set 172.30.1.1:5000 as a Registry Mirror in your Docker installation You’ll need download the oc Client Tools Note: If you want to learn about OpenShift and what can you do with it, I recommend the free book: Openshift for Developers.
dotnet new templates for AWS Lambda and Raspberry Pi
·134 words·1 min
dotnet aws
After reading the following articles: How to create your own templates for dotnet new Custom Project Templates Using dotnet new and having a twitter conversation with Sayed-Ibrahim-Hashimi I decided it was a nice idea to create some templates based on the code of some of my posts. So here are the results:
Deploy your ASP.NET Core Web API to AWS Lambda
·832 words·4 mins
dotnet aspnetcore aws serverless
Today I’ll show you how to Deploy your ASP.NET Core Web API to AWS Lambda. First be aware of the following prerequisites: You’ll need an AWS account: https://aws.amazon.com/ You’ll need AWS CLI installed: http://docs.aws.amazon.com/cli/latest/userguide/installing.html You’ll need your AWS security credentials Some basic knowledge on AWS Stacks, API Gateway, Lambda and Buckets Now let’s start: Create a folder for your new project # Open a command promt an run
Step by step: .NET Core and Azure Cosmos DB
·444 words·3 mins
azure dotnet cosmos db
Step by step: .NET Core and Azure Cosmos DB is a short post on how to connect to Cosmos DB, save a document and then query to find it. Let’s start: Create a Cosmos DB account # Create a Cosmos DB account in your Azure subscription. Once created get the URI and the primary Read-write key from the Keys section.
Start with Elasticssearch, Kibana and ASP.NET Core
·398 words·2 mins
dotnet aspnetcore docker elastic search kibana serilog
You want to Start with Elasticssearch, Kibana and ASP.NET Core and also want to do it fast? Let’s use Docker and find out how easy it can be: Create a folder for your new project # Open a command prompt an run
Step by step: Kafka Pub/Sub with Docker and .Net Core
·419 words·2 mins
dotnet docker kafka
Last week I attended to a Kafka workshop and this is my attempt to show you a simple Step by step: Kafka Pub/Sub with Docker and .Net Core tutorial. Let’s start: Create a folder for your new project # Open a command prompt an run
Step by step: Couchbase Lite with .Net Core
·327 words·2 mins
dotnet couchbase docker
Not long after writing Step by step: Couchbase with .Net Core I discovered Couchbase Lite, which is still in development, but it looks like a great solution for embedded NoSQL scenarios. So let’s start with this simple: Step by step: Couchbase Lite with .Net Core tutorial. Create a folder for your new project # Open a command prompt an run
Step by step: Couchbase with .Net Core
·289 words·2 mins
dotnet couchbase docker
This week I started to read an understand how Couchbase works and that’s the reason I decided to write: Step by step: Couchbase with .Net Core Tip: I’ll be using Docker to install and run Couchbase Now let’s start: Create a folder for your new project # Open a command prompt an run
Raspberry Pi: Run ASP.NET Core on Startup
·195 words·1 min
dotnet aspnetcore powershell raspberry pi
Last week I wrote: Step by step: Running ASP.NET Core on Raspberry Pi and didn’t have the time to write about running the application on startup. After browsing for a while I found this great post: Windows IoT Core: Running a PowerShell Script on Startup which showed me the way! As a prerequisite read and run the sample provided here: Step by step: Running ASP.NET Core on Raspberry Pi
Step by step: Running ASP.NET Core on Raspberry Pi
·428 words·3 mins
dotnet aspnetcore raspberry pi
After reading .NET Core on Raspberry Pi and successfully running a console application on Windows 10 IoT Core on my Raspberry Pi 3 I decided to write: Step by step: Running ASP.NET Core on Raspberry Pi. First be aware of the following prerequisites: Windows 10 IoT Core I’m running Insider Preview v.10.0.15058.0 .NET Core 2.0 SDK Now let’s start:
Twilio with .NET Core
·297 words·2 mins
dotnet twilio
Last night after reading this tweet, I decided to try out Twilio with .NET Core Your feedback led to the newly redesigned C# helper library. See what's new and take it for a spin here: https://t.co/IuD4NZLBH9 pic.twitter.com/SzLB7udU1h — twilio (@twilio) February 28, 2017 Let’s create the sample console app: Create the application # Open a command prompt and run
Create a class with .NET Core and Roslyn
·429 words·3 mins
dotnet roslyn
After my post first post on: Code Generation I decided to go a bit further, so today we’ll Create a class with .NET Core and Roslyn and write the output to the console. Let’s see: Create the application # Open a command prompt and run
.NET Core Health Endpoint Monitoring Middleware
·516 words·3 mins
dotnet monitoring
Today I’ll show a simple example of how to create a .Net Core Health Endpoint Monitoring Middleware. If you need to know about the Health Endpoint Monitoring Pattern check: https://msdn.microsoft.com/en-us/library/dn589789.aspx Create the application # Open a command prompt and run