Using IIS ApplicationPoolIdentity to run git inside a PowerShell script, run by a .NET Core web application

 

I encountered the following error, when trying to execute a PowerShell script from a .NET Core web application:

ErrorStreamEvent: System.Management.Automation.RemoteException: Could not create directory ‘/c/WINDOWS/system32/config/systemprofile/.ssh’.

ErrorStreamEvent: System.Management.Automation.RemoteException: Host key verification failed.

ErrorStreamEvent: System.Management.Automation.RemoteException: fatal: Could not read from remote repository.

 

To solve this problem, I had to give the application pool identity rights on the “C:\Windows\System32\config\systemprofile” folder.

Make sure in IIS the application pool property: “Load user profile” is set to true.

 

 

What to do when “Get column information” does not work in EF 6 edmx

This is probably due to, using temp tables in your stored procedure.

Just use real tables in the stored procedure, then use “Get column information” and then remove the real tables and switch the stored procedure back to using temp tables.

 

 

What to do when EF 6 does cannot create a complex type

Sometimes, when your stored procedure ends with a select of constants for example, EF 6 edmx can’t create a complex type.

To solve this, temporarily select columns with the same type from a real table, create the complex type and revert the stored procedure back to returning constants.

 

Unable to start debugging on the web server. The remote server returned an error: (503) Server Unavailable.

Make sure your IIS application pool is started .

 

 

How to fix Chrome error NET::ERR_CERT_COMMON_NAME_INVALID

 

If you are developing a .NET Core web application with Visual Studio and when you start debugging your application on IIS https binding, you might get the chrome error:

NET::ERR_CERT_COMMON_NAME_INVALID

 

I used PowerShell to create a certificate in the local Personal store on the server, then exported this certificate to a file on the server and then imported it back into the Trusted Root CAs via MMC (to avoid browser warnings).

https://stackoverflow.com/questions/19441155/how-to-create-a-self-signed-certificate-for-a-domain-name-for-development/22282433

To Create the new certificate for your specific domain:

Open Powershell ISE as admin, run the command:

New-SelfSignedCertificate -DnsName *.mydomain.com, localhost -CertStoreLocation cert:\LocalMachine\My

 

 

To trust the new certificate:

  • Open mmc.exe => Add / Remove Snap-in… => Certificates => Computer account => Local computer: (the computer this console is running on) => Finish
  • Go to Console Root => Certificates (Local Computer) => Personal
  • Select the certificate you have created, do right click => All Tasks => Export and follow the export wizard to create a .pfx file
    • Yes, export the private key
    • Check “Include all certificates in the certification path if possible”
    • Check “Export all extended properties”
    • Check “Enable certificate privacy”
    • Check “Password”
    • Use a password like “1234”
    • Encryption: “AE256-SHA256”
    • Choose a file path, like “C:\Temp\my.domain.cert.pfx”
  • Go to Console Root => Certificates => Trusted Root Certification Authorities and import the new .pfx file
  •  

To bind the certificate to your site:

  • Open IIS Manager
  • Select your site and choose Edit Site -> Bindings in the right pane
  • Add new https binding with the correct hostname and the new certificate

 

NOTE

I had to clear the SSL state on Windows 10 before the error in Chrome was resolved

 

 

 

 

Dealing with slow “Downloading proxy settings” in Chrome

 

Just turn off “Automatically detect settings” in Windows 10

 

 

How to revert git commit but keep changes – aka undo last commit en redo last commit

 

https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git

 

 

How to fix: SQL Server – The database principal owns a schema in the database, and cannot be dropped

 

https://dba.stackexchange.com/questions/19456/the-database-principal-owns-a-schema-in-the-database-and-cannot-be-dropped-mess

 

 

 

 

 

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.