Skip to main content

Posts

Showing posts with the label .net on linux

Dockerize a dotnet core application with SQL connectivity

Before reading this article, I am assuming that you know Docker, Dotnet core and have a dotnet core application which is trying to connect to SQL server. Read how to build aspnet core app, docker and run the docker container. If docker container is running and you are not able to connect to database, this blog should help you fix it.  Prerequisite -  Make sure code is working via running aspnet core locally via visual studio or command line. Port 1433 is opened for connecting to SQL server. Solution If you have Docker file ready, it should somewhat look like below file -  FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app # Copy csproj and restore as distinct layers COPY /SampleAPI/*.csproj ./ RUN dotnet restore # Copy everything else and build COPY . . WORKDIR /app/SampleAPI RUN dotnet publish -c Production -o publish # Build runtime image FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 WORKDIR /app/SampleAPI COPY --from=build-env /app/Sa...

Integrating AppDynamics with asp.net core

AppDynamics provide information about your application/server at single place. Application performance, integration with other systems, business transactions,  user load and exceptions, AppDynamics provide all these information under one dashboard. Integrating AppDynamics with asp.net core is very simple. Here are the steps to integrate it with your asp.net core application. 1. Download AppDynamics agent libraries from AppDynamics Download Center 2. Extract it on Linux machine and copy the extracted files in your website folder. These are the extracted files -  AppDynamics.Agent.netstandard.dll AppDynamicsConfig.json.template libappdprofiler .so 3. Rename 'AppDynamicsConfig.json.template' to 'AppDynamicsConfig.json' 4. Make the required changes as per your AppDynamics Controller setup ( assuming your AppDynamics Controller is already setup and running ) If you are using .json file, please include below lines in your AppDynamicsConfig.j...

Running dotnet on Linux

Server: Linux, version SUSE 12 To run dotnet code on Linux, the first and foremost task is to "Install Mono package on linux". Note: Mono is an open implementation of Microsoft's .Net framework, including compilers. It uses the same development libraries on Linux which are being used on Windows. Therefore, if you code and compiled some mono code on Linux,  it will work for Windows as well.       zypper is a package installation tool which is used in this scenario. If zypper is not available, check which package manager tool is installed on server. Furthermore, to verify if zypper is installed or not, type zypper on command line which will show all options if zypper is available on server else it will show 'command not found'. zypper ar -r http://download.opensuse.org/repositories/Mono/SLE_11_SP2/Mono.repo The above command will download from mentioned URL in a new repository. Here 'ar' stands for 'add repo'. After adding it to repos...