Posted on

How to Deploy ASP.NET Core Web API on IIS Windows Server

(Tested on windows server 2012r2)

Install the .NET Core Hosting Bundle on Windows Server

The .NET Core Hosting bundle is an installer for the .NET Core Runtime and the ASP.NET Core Module. The bundle allows ASP.NET Core apps to run with IIS.

Current version:.NET Core Hosting Bundle installer (direct download)

(for this test we installed version .Net Core 8 on win 2012r2)

Visual Studio : Publish on Folder

After creating the ASP.NET Core application in Visual Studio, we can use the Visual Studio Publish Tool to deploy and run our app. For this project, choose to publish to a folder. Choose the folder and hit “Finish”.

In the next screen, where you see the settings for this deploy, click on “More Actions” and then on “Edit”.

Select :

  • Deployment Mode : Complete
  • Target Runtime : win-x64 (for our server)
  • File Publish Options : Delete all existing files prior to publish (flagged)
  • Database : Default Connection edit (if yuu need it)

Save this configuration, control it an Publish.

Copy the contents of the folder on the IIS server to the folder dedicated to the new site.

IIS and new site

Create the site on IIS. For the Application Pool you have to use default .NET CLR Version : v4.0.

Open your browser and call up the site. You receive the “page not found” error (404).

Remember that a site that hosts only calls web api. To verify that it works you can use the controller that Visual Studio sets by default when creating a site. Then type:

https://www.mynewapisite.com/WeatherForecast

and you will get a result. The site works!


Posted on

c# and shadow copy – notes on library AlphaVSS

AlphaVSS

AlphaVSS is a .NET class library providing a managed API for the Volume Shadow Copy Service also known as VSS

Error loading library AlphaVSS.x64.dll

if you have error loading the library probabilly you need to install on the machine the Visual C++ 2017 Redist package.

You can find it at this link

Control shadow copy

To control shadow copy, created using alphavss library, you have to open a command prompt whith administrative priviliges and type

vssadmin

to list your shadow copy you have to type :

vssadmin list shadows

 

Posted on

Windows server – Active Directory – useful links

Move active directory roles from a domanin controller ti another

VERIFICARE E MODIFICARE I RUOLI FSMO DI UN DOMINIO WINDOWS

Backup Domain Controller

Aggiungere un Backup Domain Controller ad un dominio Active Directory esistente

Installing licenses for Remote Desktop

Licensing Mode for Remote Desktop Session Host is not Configured

Modalità gestione licenze di Desktop remoto non configurata

Gli aggiornamenti dinamici DHCP delle registrazioni DNS vengono ritardati o non elaborati

https://learn.microsoft.com/it-it/troubleshoot/windows-server/networking/dhcp-dynamic-updates-of-dns-registrations-delayed

Posted on

Immagine webcam capovolta su Windows

Se vi ritrovate l’immagine della vostra fotocamerawebcam capovolta il problema sono i driver.

Dovete andare sul sito del produttore, scaricare i driver giusti e quindi installarli. Il problema è che potreste non trovare i driver giusti : per esempio se il vostro computer portatile montava all’origine windows 7 e voi avete eseguito l’upgrade a Windows 10, il produttore dell’hardware potrebbe non avere creato i driver per il nuovo sistema operativo.

Come potete risolvere se non trovate i driver giusti ?

Ci viene in aiuto un piccolo programma che consente la “correzione” dell’immagine ribaltata : ManyCam

Il programma, che deve essere in esecuzione (vi compare una icona in basso) prende in gestione la vostra webcam, filtrandone l’immagine. In pratica crea all’interno del vostro computer una seconda videocamera software che gestisce la prima videocamera hardware. Attraverso ManyCam potete girare l’immagine (tasto in alto).

Quando usate un programma che deve usare la fotocamera, come per esempio un programma per le videoconferenze, questi si trova sul computer 2 webcam : la vostra e quella di ManyCam. Selezionate quella di ManyCam per avere la visione “dritta”.

Buon Lavoro.

Posted on

Fix Windows Update errors

Open Start, type: CMD
Right click CMD
Click Run as administrator

Type each of the following then hit Enter

taskkill /f /fi "SERVICES eq wuauserv" 
(Do this multiple times)
net stop cryptSvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
rmdir C:\Windows\SoftwareDistribution\DataStore
rmdir C:\Windows\SoftwareDistribution\Download

When complete, hit Enter, then restart, then try updating again.

If that does not work..

1. Open Start, type: CMD
Right click CMD
Click Run as administrator

Type each of the following then hit Enter

Run these codes:

Net Stop bits
Net Stop wuauserv
Net Stop appidsvc
Net Stop cryptsvc
Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak
Ren %systemroot%\system32\catroot2 catroot2.bak
Net Start bits
Net Start wuauserv
Net Start appidsvc
Net Start cryptsvc

After running these commands, check if your issue is fixed.

Posted on

Onedrive – sincronizzazione in sospeso

Sul vostro computer, nella cartella di Onedrive alcuni file e cartelle hanno il simbolo della sincronizzazione, e passandoci sopra con il mouse appare la scritta sincronizzazione è in sospeso.

È necessario fare clic sul simbolo di Windows e digitare “Esegui” > copiare, incollare il seguente comando e premere invio:

%localappdata%\Microsoft\OneDrive\onedrive.exe /reset

Se la nuvoletta di OneDrive non riappare dopo alcuni minuti, devi  nuovamente fare clic sul simbolo di Windows e digitare “Esegui” > copiare, incollare il seguente comando e premere invio:

%localappdata%\Microsoft\OneDrive\onedrive.exe
Posted on

Blocco di Esplora File

File Explorer, il programma che usate per vedere cartelle e file si blocca. Tutto il computer sembra bloccato.

SOLUZIONE

In ricerca digitate CMD, vi compare l’icona del prompt del DOS. Andadeti sopra, tasto destro del mouse Esegui come Amministratore.

Scrivete quest sequenza di comandi

  1. Scrivete netsh  e premete Enter.
  2. Scrivete winsock e premete Enter.
  3. Scrivete reset e premete Enter.