Category: .NET Core

Caching data backend–.NET Core–part 49

We have 2 options to cache data: One in webAPI, one when returns from database.

For WebAPI, I have read https://docs.microsoft.com/en-us/aspnet/core/performance/caching/response?view=aspnetcore-3.1

and

https://docs.microsoft.com/en-us/aspnet/core/performance/caching/middleware?view=aspnetcore-3.1

It is also important to read the conditions for caching : https://docs.microsoft.com/en-us/aspnet/core/performance/caching/middleware?view=aspnetcore-3.1#conditions-for-caching ( e.g. only GET or HEAD is cached)

It is just very easy – see github commit https://github.com/ignatandrei/InfoValutar/commit/b8d38658b5135e4d3c93da78f77ffb9f01376829

Also, can be tested by setting a breakpoint in VisualStudio  – see that is activated just 1 time.

Now, the interesting part – I need the cache for the remaining of the day, in case the exchange rate is in the same day .

Because I need this functionality for both ECB and BNR banks( and may for others), I either create a C# extension, either a base class (instead of an interface ) , either I use a feature of C# 8,  interface that have implementations.

The first try is here: https://github.com/ignatandrei/InfoValutar/commit/3aeeab7a5c519493764a365885b812f3da6ccb8e

Where I have do the code wrong: the key to cache and the items to cache are different. See

https://github.com/ignatandrei/InfoValutar/commit/a68da1f16a27ae06c7978d3acd9b2f1ba1bebc0f

I am using Memory Cache

namespace InfoValutarShared
{
#pragma warning disable IDE1006 // Naming Styles
public interface BankGetExchange
#pragma warning restore IDE1006 // Naming Styles
{
public string Bank { get; }
Task<IEnumerable<ExchangeRates>> GetActualRates();
DateTime Key()
{
var now = DateTime.UtcNow;
if (now.DayOfWeek == DayOfWeek.Sunday)
now = now.AddDays(-1);
if (now.DayOfWeek == DayOfWeek.Saturday)
now = now.AddDays(-1);
return now;

}
IEnumerable<ExchangeRates> TodayFromCache
{
get

{
var keyDate = Key();
string key = $”{this.Bank}_{keyDate.ToString(“yyyyMMdd”)}”;
var mc = MemoryCache.Default;
if (mc.Contains(key))
return mc[key] as ExchangeRates[];

return null;

}
set
{
var keyDate = Key();
string key = $”{this.Bank}_{keyDate.ToString(“yyyyMMdd”)}”;
var mc = MemoryCache.Default;
value = value
.Where(it => Math.Abs(it.Date.Subtract(keyDate).TotalDays) < 1)
.ToArray();
if (value.Any())
{
mc.Set(key, value, DateTime.UtcNow.AddDays(7));

}
}
}

}
}

and using this like this

public async Task<IEnumerable<ExchangeRates>> GetActualRates()
{
var b = this as BankGetExchange;
if (b.TodayFromCache != null)
return b.TodayFromCache;

//code omitted

}
b.TodayFromCache = ret;

return ret;

 

And this is it…

Routing angular with .net core and RxJs switchmap- part 46

Now the problem is that the route

 

works if I access first the index.html file, but it does not route when entered directly

Trying to get from SPATemplate

https://github.com/ignatandrei/InfoValutar/commit/a364dc57653ac2ba04ab0596f1540a8f9fdb73f6

However, this will redirect ALL routes to index.html – including swagger and API.  Trying to learn more – looking at the code.

I have observed that I have put

app.UseOpenApi();
app.UseSwaggerUi3();

after

this.route.params.pipe(

tap(rp => {

this.idBank = rp.id;

})

, switchMap((it) => this.bs.GetRates(it.id))

, tap(v => this.rates = v)

).subscribe();

What If I put first?

app.UseOpenApi();
app.UseSwaggerUi3();

app.UseSpa(spa =>

 

And it works! https://github.com/ignatandrei/InfoValutar/commit/726ebd07095ea62387d4eeebb017b4f6ae4ab8e6

What I need more, is to retrieve the exchange rates for today for the selected bank.

The code to retrieve the bank id was:

this.route.params.subscribe(rp => {

this.idBank = rp.id;

}

);

I can put into subscribe the next call, but it will be not so nice ( subscribe into subscribe into subscribe)

this.route.params.subscribe(rp => {

this.idBank = rp.id;

this.bs.GetRates(it.id).subscribe( ….)

}

)

 

Instead of this, I use switchMap , pipe and tap

this.route.params.pipe(

tap(rp => {

this.idBank = rp.id;

})

, switchMap((it) => this.bs.GetRates(it.id))

, tap(v => this.rates = v)

).subscribe();

To fast show data, I use the Json pipe from Angular

<ul>

<li *ngFor=”let rate of rates”>

{{rate | json}}

</li>

</ul>

Modifications at https://github.com/ignatandrei/InfoValutar/commit/a27c7c7beb4ea10b9f8a522b01d558c6003d5386

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

.NET Core 3.0 to .NET Core 3.1 and .NET Core SSL (https )with VSCode + Docker –part 44

To pass from .NET Core 3.0 to .NET Core 3.1

  1. Modify the .csproj
  2. Modify the devops
    • Modify the GitHub Actions
    • Modify the Azure Devops ( because was on Docker , just modify the docker FROM sdk
  3. Modify the dockerfile in the  .devcontainer folder to run in VSCode Container

Some of the modifications here : https://github.com/ignatandrei/InfoValutar/commit/2d5b138ccd6225a6bf69dca47fe76e2270920d2d

However, to have running in Docker container with SSL it is much more difficult. The instruction were here 

https://github.com/microsoft/vscode-dev-containers/blob/master/containers/dotnetcore-3.0/.devcontainer/devcontainer.json

However, some of them implied sharing local pfx , others implies modifying the dockerfile.

And the fact that I should be rebuild the container does not help …as time goes by.

If you look at

https://github.com/ignatandrei/InfoValutar/commit/c371e67aea3a283d3b8c208eec168c795f6fe680

you can see what is necessary that now I have for InfoValutar both .NET Core WebAPI and Angular WebSite running in VS Code on Docker containers.

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Configure Angular Environment(local and remote) and CORS for .NET Core – part 43

I want to be capable to run Angular with data obtained from local .NET project in development – and from remote website in production. One of the techniques is detailed here

https://angular.io/guide/build

Generated service :

ng g s banks

Now I want to see that every modification of the Bankservice will re-compile. Tried in Docker to run

ng serve –host 0.0.0.0  –poll 200

but it does not show modifications of files changing.

The problem is that not show the files changing generated inside. Time to re-build the docker container for angular

docker container prune -f

docker images “vs*”

docker image rm <id of the prev image>

No modification. The problem was: the BankService was not referenced yet! If I refeerence to the BankComponent, the poll works!

Now let’s see if the Angular Web can access .NET Core WebAPI – no. I forgot to add CORS:

public void ConfigureServices(IServiceCollection services)
{
     services.AddCors(options =>
     {
         options.AddPolicy(“AllowedAll”,
         builder =>
         {
             builder
                 .AllowAnyHeader()
                 .AllowAnyOrigin()
                 .AllowAnyMethod();
         });

    });

// code

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{

    if (env.IsDevelopment())
     {
         app.UseDeveloperExceptionPage();
     }

    app.UseCors(“AllowedAll”);

and now it works – I can see in Angular Web App the banks.

The modifications are in

https://github.com/ignatandrei/InfoValutar/commit/2106328935b972a4411f5412ba3fc810a46399b8

Adding Angular to WebAPI site-part 41

First, I want to add an index.html file – to see the result.

For this, I add to the startup:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
         //more code
app.UseDefaultFiles();
app.UseStaticFiles();

I also add an index.html into a wwwroot folder ( also created into the root)

You can see the modifications here: https://github.com/ignatandrei/InfoValutar/commit/4deb32528aee7b667f22a38c8e96899052cbfd4c

Now I want to compile the Angular application and add the index html generated by Angular to the wwwroot site

I create a powershell ( easy for me , because you can install dotnet tool powershell )

echo “starting build angular”
cd InfovalutarWebAng
npm i
ng build  –prod –build-optimizer
cd ..

$source= “InfovalutarWebAng/dist/InfovalutarWebAng/”
$dest= “InfoValutarWebAPI/wwwroot/”
echo “delete files”
Get-ChildItem -Path $dest -Include *.* -File -Recurse | foreach { $_.Delete()}
echo “copy files”
Get-ChildItem -Path $source | Copy-Item -Destination $dest

and put in Azure Devops pipelines

 
– powershell: |
       cd InfoValutar
       .\copyAng.ps1
   displayName: copy angular site to web api

Now commit in GitHub (https://github.com/ignatandrei/InfoValutar/comAmit/5208036a4cb1da719692966880236dc33b1b2e74 )and waiting to see if it works

The error is : “The term ‘ng’ is not recognized as the name of a cmdlet, function, script file, or

The term ‘ng’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the

spelling of the name, or if a path was included, verify that the path is correct and try again.

Adding

npm i -g @angular/cli

It works!

Last Commit info–GitHub and AzureDevOps–part 39

I was thinking that I need to see the date of last CD – who done what. For this, I need 2 things: to have a controller/gui to show the info and the CD process, via GitHub/AzureDevOps  ,to take care of that.

For the part with code, the problem was pretty simple:

 

using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace InfoValutarWebAPI.Controllers
{
    /// <summary>
    /// info about commit
    /// </summary>
    public class LastCommitInfo
    {
        /// <summary>
        /// comment latest commit
        /// </summary>
        public string LatestCommit { get; set; }
        /// <summary>
        /// last date of commit
        /// </summary>
        public DateTime DateCommit { get; set; }
        /// <summary>
        /// last author of commit
        /// </summary>
        public string LastAuthor { get; set; }
    }
    /// <summary>
    /// controller about info the application
    /// </summary>
    [ApiController]
    [ApiVersion("1.0")]
    [Route("api/v{version:apiVersion}/rates")]
    public class InfoController
    {
        /// <summary>
        /// info about latest commit
        /// </summary>
        /// <returns></returns>
        public LastCommitInfo GetLatestCommit()
        {
            return
                new LastCommitInfo()
                {
                    LatestCommit = "{LatestCommit}",
                    DateCommit = DateTime.ParseExact("{DateCommit}", "yyyyMMdd:HHmmss", null),
                    LastAuthor = "{LastAuthor}"
                }
                ;
        }
    }
}

 

What about the CD process ?

Well, this was cumbersome. To see ALL the environment  variables, I used cmd /K set ( in command ) or Get-ChildItem Env: ( in powershell).

And I come with this:

A bash script to take the version

– bash: |

git log –format=’%s’ -1

git log –pretty=oneline | head -1

gitMessage=$(git log –format=’%s’ -1)

echo “##vso[task.setvariable variable=commitMessage;isOutput=true]$gitMessage”

displayName: Store commit message in variable

– powershell: .\modifyinfo.ps1

displayName: modify info

 

And a  .ps1 powershell

$file = “.\InfoValutar\InfoValutarWebAPI\Controllers\InfoController.cs”

$date = Get-Date -Format “yyyyMMdd:HHmmss”

Get-ChildItem Env:

$author= $Env:BUILD_SOURCEVERSIONAUTHOR

$commitText = $env:BASH_COMMITMESSAGE

((Get-Content -path $file -Raw) -replace ‘{LatestCommit}’,$commitText -replace ‘{LastAuthor}’,$author -replace ‘{DateCommit}’ , $date ) | Set-Content -Path $file

(Get-Content -path $file -Raw)

The result can be seen at  https://infovalutar.azurewebsites.net/api/v1.0/info

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Exchange rates–what I have done in 37 hours–part 38

What I have create for now in 37 hours :

  1. A source control – https://github.com/ignatandrei/InfoValutar
  2. A plugin based software – you can use to load any kind of exchange rates, for anywhere , provided that you implement the interface – see implementation
  3. Tests for some of the code
  4. Deployment:
  5. A SqlServer database – to store datas
  6. An Azure Function  – https://azurefuncloaddata20191205080713.azurewebsites.net/ –  to load data at time based cron intervals
  7. A GitHub action to compile ,run tests , – https://github.com/ignatandrei/InfoValutar/actions
  8. An AzureDevops CI + CD  to do all 1-6 things +code coverage + deploy https://dev.azure.com/ignatandrei0674/InfoValutar/_build?definitionId=5&_a=summary

 

I did say it is a nice work for 37 hours of work, right ?

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Azure functions – final–part 37

So , I said, now just retrieve data – and put on database:

try
             {
                 log.Info(“trying to save”);
                 ISave save = new SaveSqlServer(null);
                 await save.Save(data.ToArray());
             }
             catch(Exception ex)
             {
                 log.Error($”ERROR !! {ex.Message}”);
             }

This gives me a new whole error:

ERROR !! Could not load type ‘System.IAsyncDisposable’ from assembly ‘netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’.

Ok. Coming from start: What I want ? To save recent data into the database and checking at regular times. How to do that ? Simple . Just call https://infovalutar.azurewebsites.net/api/v1.0/save/LoadAndSaveAll

Good. So this should be the code:

log.Info($”LOAD from website: {DateTime.Now}”);
             Console.WriteLine(“————————!!”);
             var url = “https://infovalutar.azurewebsites.net/api/v1.0/save/LoadAndSaveAll”;
             var http = new HttpClient();
             var data = await http.GetStringAsync(url);
             log.Info($”obtaining data {data}”);

And … it works flawless! – For BNR – for ECB it shows just a record. That is somehow strange – the coding was almost the same

Now it is time to wrote some more tests  -and to find if ECB is loading more than 1 record. Yes, it is.

Then the problem is when saving? Or when loading ?

I have the result of saving :

public class ResultsLoadBankData
     {
         public string Bank { get; internal set; }
         public int NrRecords { get; internal set; }
         public bool HasSuccess { get; internal set; }
         public string ErrorMessage { get; internal set; }
     }

And I modified to this

public class ResultsLoadBankData
     {
         public string Bank { get; internal set; }
         public int NrRecordsLoaded { get; internal set; }
         public int NrRecordsSaved { get; internal set; }

        public bool HasSuccess { get; internal set; }
         public string ErrorMessage { get; internal set; }
     }

Also , there were many other small modifications when loading data.

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

IAsyncEnumerable transformed to IEnumerable and making Azure Functions works- part 36

Last time I have had problems because of IAsyncEnumerable not be loaded from SystemRuntime. Decided to modify code to use instead Task<Ienumerable>

The code modifications were interesting

await foreach (var e in nbr.GetActualRates())

//versus
  foreach (var e in await nbr.GetActualRates())

yield return exch;

//versus adding to a list and return the list
  ret.Add(exch);

var data = await nbr.GetActualRates().ToArrayAsync();

//versus

var data = (await nbr.GetActualRates()).ToArray();

All in all, not so difficult.Code changes at https://github.com/ignatandrei/InfoValutar/commit/d2744dd0cc194c6e63c7efc2f262ec1b233bde7c

To test in production, it does not help that AzureDevops is taking 7 minutes. Trying in the meantime to setup AzureDevOps on my PC.

In Azure Function – the same error occurred.

Ok . Now trying to see if something smaller can be possible. Rather to load every plugin to give information, maybe I can load just the plugins directly.

Cannot bind parameter ‘log’ to type ILogger

Apparently, a known issue for package hell . Reading

https://docs.microsoft.com/en-us/sandbox/functions-recipes/logging?tabs=csharp

Commuting to TtraceWriter

Now deployng from Visual Studio =>error: System.IO.FileNotFoundException: Could not load file or assembly ‘netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’

Re-doing via CI – AzureDevOps : WORKS!

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Azure function–solving my own code problems–part 35

1. My fault – the plugins does not exists in output

this should be added to the output in order to the plugins to be copied to the output directory

<ItemGroup>
<None Remove=”plugins\” />
<Content Include=”plugins\**\*.dll” CopyToOutputDirectory=”Always” />
</ItemGroup>

2. Deploying  , I should see what it is convenient: context.FunctionDirectory  OR context.FunctionAppDirectory

log.LogInformation($”!!! C# Timer trigger function executed at: {DateTime.Now} next {myTimer.FormatNextOccurrences(1)} “);
var folder = Path.Combine(context.FunctionDirectory, “plugins”);
log.LogInformation($”!!! Folder {folder} Folder exists: {Directory.Exists(folder)}”);

folder = Path.Combine(context.FunctionAppDirectory, “plugins”);
log.LogInformation($”!!!Folder {folder} Folder exists: {Directory.Exists(folder)}”);

3. Plugins loading – missing dll’s

Because I work with Nate Mc Master Plugins  , https://github.com/natemcmaster/DotNetCorePlugins, I encounter the  error “ could not load file or assembly ‘System.Runtime.Loader, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

I was trying self-contained in building Azure  – does not publish the file ‘System.Runtime.Loader . But the InfoValutarLoadingLibs/InfoValutarLoadingLibs.csproj it does!

Solution : publish self contained loading libs, build azure function , copy files from loading libs to azure function project

4. Now encountering this one:

https://github.com/Azure/Azure-Functions/issues/1250

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.