Posts

Why should I migrate my .NET Framework applications to .NET Core/.NET 6?

The most famous project among the .NET platform was the now hated Asp.Net WebForms , which helped many companies on that time to migrate some legacy Windows Forms application to the Web platform, once the Visual Studio allowed developers to drag and drop web controls in visual design mode, a similar experience that took place for desktop applications. I know that feature usually did not generate the best HTML ever, but I think the idea was good in general and had its value at the beginning of it. The Asp.Net Web Forms had a not good performance in many cases, once everything was rendered in the backend, including the HTML, keeping the state using “tricks” with View State. The payload of each page could be enormous in many cases, but it was pretty easy to develop with. The .NET Framework introduced the Asp.Net MVC project template in order to follow the good practices used in the rest of the market. It was a tremendous success because it was possible to separate responsibilities betwee...

What is WebAssembly?

Image
  WebAssembly is based on open web standards. So it is a native part of all modern browsers including mobile browsers. This means for the blazor application to work, there is no need to install any special plugin like back in the days of silver light and flash. Browsers understand and execute only JavaScript. How can we execute c# code in the client browser?  Well, the answer is WebAssembly Blazor can run C# code directly in the browser, using WebAssembly. It runs in the same security sandbox as JavaScript frameworks like Angular, React, Vue etc. Not just C#, in fact, we can run any type of code in the browser using WebAssembly

What is Blazor?

Image
  Before we see the actual definition of Blazor, we must understand below  For server-side development, we use programming languages like C#, Java, PHP etc. These are the server-side programming languages. For the client-side development we use JavaScript frameworks like Angular, React, Vue etc. There’s no doubt these JavaScript frameworks dominated client-side development up until recently.  To stay in the business as a developer and remain competitive, it's inevitable we learn both a server-side programming language and a client-side programming language But the question is, why should we learn and use 2 different sets of programming languages and frameworks. Can we use C# both for server-side and client-side development? Well, we can and that's exactly why we use Blazor. With Blazor we can now build interactive web UIs using C# instead of JavaScript. C# code can be executed both on the server and in the client browser. This means existing .Net developers can reuse thei...

Service Oriented Architecture

Image
  Service Oriented Architecture (SOA) A Service-Oriented Architecture or SOA is a design pattern which is designed to build distributed systems that deliver services to other applications through the protocol. It is only a concept and not limited to any programming language or platform. What is Service? A service is a well-defined, self-contained function that represents a unit of functionality. A service can exchange information from another service. It is not dependent on the state of another service. It uses a loosely coupled, message-based communication model to communicate with applications and other services. Service Connections The figure given below illustrates the service-oriented architecture. Service consumer sends a service request to the service provider, and the service provider sends the service response to the service consumer. The service connection is understandable to both the service consumer and service provider. Services -  The services are the logical en...

Visual Studio 2022 new features

Image
Microsoft Officially released Visual Studio 2022 for general availability on Nov-2021. The Primary focus of Visual Studio 2022 is developer productivity and quality of life improvements. These are the five new features of Visual Studio 2022 that I find most exciting: 64-bit IDE .NET 6 support Intellicode Hot reload Find in Files is faster   A 64-bit IDE  Finally, Visual Studio ships as a 64-bit application. So, you can see a   considerable improvement in the project loading and execution time when   compared to previous versions. You can now work on projects of any size and   complexity. The following image from Microsoft DevBlogs shows how fast   Visual Studio 2022 can load 1,601 projects with 298,326 files.  .NET 6 support   Complete support for  .NET 6  is now available with Visual Studio 2022. The        framework .NET 6 is a unified framework. It supports developing web, client,   an...

How to use two different versions of same dll in ASP.Net?

Image
  When using 3rd party libraries, sometimes they let out a new version. And sometimes that new version breaks something that used to work in the old version, but also adds features you need. So you found yourself having to use one method from the old version and another from the new version of the same library. There are two problems here: It won’t compile. Both libraries have the same namespace, causing ambiguity the compiler can’t handle. It won’t run. The referenced DLLs are copied to the output dir, but because they have the same name, they will override each other, and will cause the runtime loading of the assembly to have a version mismatch. Welcome to DLL hell. The solution Let’s take my client’s project as a practical example. The project was using a 3rd party library by Winnovative Software, for handling pdf operations. The new version of the dll broke some specific functionality that had to be supported. The DLL name:  wnvhtmltopdf.dll  The old version: 14.2 The...

YAML

YAML  Ain't Markup Language ( YAML ) is a serialization language that has steadily increased in popularity over the last few years. This blog provides a basic overview of correct YAML syntax, which is how Ansible playbooks are expressed. We use YAML because it is easier for humans to read and write than other common data formats like JSON or XML.  also, there are libraries available in most programming languages for working with YAML. YAML Basics  For Ansible, nearly every YAML file starts with a list. Each item in the list is a list of key/value pairs, commonly called a “hash” or a “dictionary”. So, we need to know how to write lists and dictionaries in YAML. There’s another small quirk to YAML. All YAML files (regardless of their association with Ansible or not) can optionally begin with  ---  and end with  ... . This is part of the YAML format and indicates the start and end of a document. All members of a list are lines beginning at the same indentation lev...