How to manually update Microsoft Teams

 

 

 

 

Pdf.js (ng2-pdf-viewer) is trying to access the internet (cloudflare) to load the pdf.js worker (pdf.worker.js) and I don’t want that

By default “ng2-pdf-viewer”: “6.3.0” will use cdnjs.cloudflare.com for the pdf.js worker download location.

See https://github.com/VadimDez/ng2-pdf-viewer/blob/master/README.md#set-custom-path-to-the-worker

In order to load the pdf.worker.js from the local server, we need to set the pdfWorkerSrc:

 

// NOTE: for this to work, the angular CLI needs to copy files form the “node_modules/pdfjs-dist/build” to the “/assets/pdfjs” folder.

    // This is accomplished by adding the row:

    // { “glob”: “**/*”, “input”: “node_modules/pdfjs-dist/build”, “output”: “/assets/pdfjs” }

    // inside the angular.json > projects > my-application > architect > build > options > assets

    //

    // We only need the pdf viewer to work, when the user is “logged in”, so we configure the pdf-viewer here.

    (<any>window).pdfWorkerSrc = ‘assets/pdfjs/pdf.worker.js’;

 

In the angular.json add:

“assets”: [

              { “glob”“**/*”“input”“node_modules/pdfjs-dist/build”“output”“/assets/pdfjs” }

            ],

 

 

How to refresh EF from database by using the edmx designer

Open the edmx with the designer

Right click on the designer > Update Model from Database… > Finish

NOTE: Now it will refresh the edmx, but the generation of all EF entity classes will only happen after you save the adjusted “.edmx”.

 

 

How to update only one stored procedure in EF by using the Model Browser

Open the “.edmx” file in Microsoft Visual Studio

Open the model browser:

View >

Other Windows >

Entity Data Model Browser >

Your_Model >

Function Imports >

right click on your_stored_procedure > Edit

 

 

Klik on “Get Column Information”

 

 

 

Klik on Update

 

 

Click on OK and save the generated / updated files.

 

IIS application pool can’t be started directly after it has been stopped with PowerShell

I used the PowerShell cmdlet Stop-WebAppPool to stop an IIS application pool, before deploying a new version,

but when I tried to start het IIS application pool inside the PowerShell script by using the cmdlet Start-WebAppPool I got the error:

The service cannot accept control messages at this time. (Exception from HRESULT: 0x80070425)

To fix this, I added the following lines of code to my script:

$applicationPoolName = “My-App-Pool-Name”

 

Write-Output “Wait untill application pool stopped”

    $applicationPoolStopped = $false;

    do{

        $applicationPoolStopped = Get-WebAppPoolState -name “$($applicationPoolName)”

        if ($status.Value -eq “Stopped”){

            $applicationPoolStopped = $true;

        } else {

            Write-Output “Application pool not yet stopped, waiting for 10s to check state again”

            Start-Sleep -s 10

        }

    }

    while (!$applicationPoolStopped)

 

This script will check the status of the application pool every 10s.

NOTE: If the application pool will never get the status “Stopped” this script will never stop.

 

How to squash git commits

 

https://www.internalpointers.com/post/squash-commits-into-one-git

error: you need to resolve your current index first

git reset –merge

 

To abort a rebase

git rebase –abort

 

 

 

 

 

 

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.