Dotnet-Core

500.19 Error After Deploying .Net Core Solution

Solution:

The solution is very straight forward, just go to Microsoft dotnet-core website, download and install the run time along with hosting package and you are good to go.

I am using Dotnet-Core 2.1.11 on windows so I downloaded the package as highlighted below:

For some reason if you get the below error, that surely mean that you have installed wrong version of the dotnet-core, you don’t need to uninstall previously installed package for most cases, just install the correct version and you are good to go.

http error 502.5 – process failure asp.net core 2.1

Advertisements
Development, Entity Framework, Uncategorized

How to force Entity Framework to Always Load Fresh copy of Data from the Database

How to force Entity Framework to Always Load Fresh copy of Data from the Database

Solution:

There are many solution to achieve this result.

The most popular and easiest one is to dispose the existing context object and create new one

entities.Dispose();
entities = new Entities(); // DbContext

but it is not optimal you are disposing whole context which could be very expensive.

Optimal Solution:

Db.Entry(item).Reload(); // Db here means DbContext

this will only load the entity (item) you passed from the database and if you changed the item before reload, after reload the change will be overwritten by the values coming from database.

For more information Please check

Azure App Service, Development

How to serve WOFF fonts from Azure App Service

How to serve WOFF fonts from Azure App Service.

Solution:

1. Locate or create web.config

If you have asp.net application you will find the web.config but if you have hosted any other distrubution such as wordpress you can still create the web.config if this is not presented already.

2. Include/merge below code in web.config


  
    
      <mimeMap fileExtension="woff" mimeType="application/font-woff" />
      <mimeMap fileExtension="woff2" mimeType="application/font-woff" /> 
    
  

How to do it:

Go to Azure portal -> Locate your App Service -> Under Development Tools click on Advanced Tools -> click on Go link

How to serve woff font files from Azure App Service

A new tab will be opened and you will see Kudu logo, select Debug console and then CMD

Kudu click on cmd - How to serve woff font files from Azure App Service .png

Now navigate to the D:homesitewwwroot and find the web.config, if you find it then merge the code, else create it and copy paste the code mentioned in step 2.

In fact you can put any file extension you want to serve Azure App Service to serve as static file.

Merge web.config entreies - How to serve woff font files from Azure App Service.png

For more Details