Posts

Showing posts from 2018

Host ASP.NET Core 2.1 application on Ubuntu Server 18.04

To understand and apply this, first see: Host ASP.NET Core on Linux with Nginx The tutorial from above is pretty straightforward, but is for Ubuntu Server 16.04. In the following, i will show you how to bypass the problems when hosting ASP.NET Core 2.1 application on Ubuntu Server 18.04. The first problem is installing the SDK, for Ubuntu Server 18.04 use: shell> curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg shell> sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg shell> sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list' shell> wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb shell> sudo dpkg -i packages-microsoft-prod.deb shell> sudo apt-get install apt-transport-https shell> sudo apt-get update shell> sudo apt-get inst...

How to: Transform Web.config When Deploying a Web Site Project

Publishing a Web Site project with Visual Studio does not support Web.config transform files. In the following, I will show you how to use the same functionality from a Web Application project (see:  How to: Transform Web.config When Deploying a Web Application Project ) in a Web site project. You have to create a publish profile for the Web Site project and add an MSBuild step in the "website.publishproj" file: <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">   ...   <Import Project="$(_WebPublishTargetsPath)\Web\Microsoft.WebSite.Publishing.targets" />   <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />   <Target Name="BeforeBuild">     <TransformXml ...

DevTalks Bucharest 2018 review

Dev<Talks/> brings together great community leaders and innovation, this year’s stages featured: Devops, Emerging tech, Web & Mobile, Datafication, Java, Product Management, Automotive and a variety of workshops. This is the 5th edition of Dev<Talks/> Bucharest and it took place in the Romexpo exhibition complex. As in the previous years, it started early in the morning, around 9 AM. First I had to register and then get the badge and the agenda for the day (the online version of the agenda: http://www.devtalks.ro/bucharest/agenda/ ). This year I attended only presentations from the DevOps stage. It was not quite what I expected it to be, there were some presentations that were not related to the DevOps field and very few that had a hands-on approach. Besides that, there were some very good presentations: "Continuous Delivery – one for all and all for one" by Ionut Hrinca: he presented the struggle of ING Tech company...

Building a schedule manager with Quartz

Contents Introduction Prerequisites Schedule manager Putting it all together Introduction Create simple schedule manager using Quartz library ( https://www.quartz-scheduler.net/ ) Prerequisites IDE: Microsoft Visual Studio or Visual Studio Code NuGet packages: https://www.nuget.org/packages/Quartz/3.0.5 https://www.nuget.org/packages/log4net/2.0.8 Schedule manager The schedule manager allows you to: start the schedule manager suspend jobs firing for the schedule manager stop the schedule manager schedule a job (CRON trigger + timezone or Quartz trigger) unschedule a job run a job on demand Usage: ScheduleManager.Instance.Start(); // schedule an every 15 seconds test job ScheduleManager.Instance.ScheduleJob<TestJob>( "testJob" , "testGroup" , "0/15 * * * * ?" ); // some sleep to show what's happening Task.Delay(TimeSpan.FromSeconds(60)).Wait(); ScheduleManager.Instance.Stop(); Putt...

Juice this "static" up a little

    Static members and methods are basically the same as a non-static members and methods, but there is one difference: you don't need an instance variable to access them. For example, if you have a static class that is named HelperClass  that has a public method named DoStuff , you call the method as shown in the following example: HelperClass.DoStuff()     For more information about statics see " Static Classes and Static Class Members (C# Programming Guide) ".     The good about statics: single point data manipulation less memory usage (no instances) faster access/call times (the compiler generates overhead for non-static members and methods) low level of code complexity     The bad about statics: statics limitations (no inheritance, no overriding, can't use non-statics, etc.) code rigidity harder to test no control over the life cycle (remains in memory for the lifetime of the application domain) ...