82e0d6bc77
## Nuovi file - DataConnection/DB/OleDbDatabaseManager.cs: Manager completo per connessioni OLE DB con supporto Task.Run() per operazioni sincrone, parametri posizionali '?', guard per piattaforma Windows, nessun supporto ChangeDatabaseAsync (no-op) - DataConnection/DB/EF/SchemaProviders/OleDbSchemaProvider.cs: Schema provider per OLE DB, usa OleDbSchemaGuid per tabelle/colonne/chiavi primarie, mapping tipi dati - CredentialManager/Services/OleDbProviderDiscoveryService.cs: Servizio di discovery provider OLE DB installati tramite registro Windows (HKEY_CLASSES_ROOT). Rileva 9 provider noti: VFPOLEDB.1, Microsoft.ACE.OLEDB.12.0, Jet 4.0, SQLOLEDB, ecc. Mostra warning per provider solo 32-bit (VFPOLEDB, Jet) - PUBLISH_32BIT_64BIT.md: Documentazione completa comandi pubblicazione per win-x64, win-x86 (richiesto per VFP), linux-x64, osx-x64, osx-arm64. Include prerequisiti VFPOLEDB, esempi connection string VFP, note Docker ## File modificati - DataConnection/DB/Enums/DatabaseType.cs: Aggiunto valore OleDb dopo Odbc - DataConnection/DataConnection.csproj: Aggiunto pacchetto System.Data.OleDb 9.0.3 - DataConnection/DB/OdbcDatabaseManager.cs: Fix bug ChangeDatabaseAsync con try-catch - CredentialManager/Models/CredentialModels.cs: Aggiunto OleDb all'enum DatabaseType, BuildOleDbConnectionString() con supporto provider da AdditionalParameters, default VFPOLEDB.1, costruzione connection string con parametri VFP - DataConnection/CredentialManagement/Models/CredentialExtensions.cs: Mappatura OleDb in ToDataConnectionDatabaseType() e ToCredentialDatabaseType() - DataConnection/CredentialManagement/Services/DataConnectionCredentialService.cs: Aggiunto case OleDb in TestDatabaseConnectionAsync e metodo TestOleDbConnection() con apertura connessione via Task.Run() e gestione OleDbException dettagliata - Data_Coupler/Services/DataConnectionFactory.cs: Aggiunto case OleDb per creazione OleDbDatabaseManager - Data_Coupler/Program.cs: Registrazione IOleDbProviderDiscoveryService come Scoped - Data_Coupler/Pages/CredentialManagement.razor: Aggiunta UI completa OLE DB con sezione dedicata Visual FoxPro (percorso .dbc/.dbf, Collating Sequence, DELETED), provider discovery con refresh, anteprima connection string, variabili di stato e metodi nel codice Blazor, sincronizzazione AdditionalParameters al salvataggio ## Compatibilità - VFP 8.0/9.0: testato con VFPOLEDB.1, connessione file-based .dbc e .dbf - Richiede pubblicazione win-x86 per driver OLE DB 32-bit - AnyCPU non supportato per VFP (COM 32-bit)
165 lines
4.4 KiB
Markdown
165 lines
4.4 KiB
Markdown
# Pubblicazione Data-Coupler: Guida 32-bit e 64-bit
|
|
|
|
## Perché è importante scegliere la piattaforma target
|
|
|
|
Alcune tecnologie di connessione sono vincolate alla piattaforma (32-bit o 64-bit):
|
|
|
|
| Tecnologia | Supporto | Note |
|
|
|---|---|---|
|
|
| **VFPOLEDB.1** (Visual FoxPro) | **Solo 32-bit** | Driver COM 32-bit, incompatibile con processi 64-bit |
|
|
| **Microsoft.ACE.OLEDB.12.0** (Access 2010) | 32-bit o 64-bit (match) | Installa la versione corrispondente all'app |
|
|
| **Microsoft.Jet.OLEDB.4.0** | **Solo 32-bit** | Driver legacy |
|
|
| ODBC generico | Dipende dal driver | Usa Gestore ODBC a 64-bit per driver 64-bit |
|
|
| SQL Server, MySQL, PostgreSQL, ecc. | 64-bit (consigliato) | Driver nativi .NET, nessun vincolo |
|
|
|
|
---
|
|
|
|
## Comandi di Pubblicazione
|
|
|
|
### 1. Pubblicazione Windows 64-bit (default, consigliato per SQL Server/MySQL/API REST)
|
|
|
|
```powershell
|
|
dotnet publish Data_Coupler/Data_Coupler.csproj `
|
|
--configuration Release `
|
|
--runtime win-x64 `
|
|
--self-contained true `
|
|
--output ./publish/win-x64
|
|
```
|
|
|
|
**Usa per**: SQL Server, MySQL, PostgreSQL, Oracle, REST API, ODBC 64-bit
|
|
**Non usare per**: VFPOLEDB, Jet 4.0
|
|
|
|
---
|
|
|
|
### 2. Pubblicazione Windows 32-bit (richiesta per Visual FoxPro / VFPOLEDB)
|
|
|
|
```powershell
|
|
dotnet publish Data_Coupler/Data_Coupler.csproj `
|
|
--configuration Release `
|
|
--runtime win-x86 `
|
|
--self-contained true `
|
|
--output ./publish/win-x86
|
|
```
|
|
|
|
**Usa per**: VFPOLEDB.1 (Visual FoxPro 8/9), Microsoft.Jet.OLEDB.4.0, driver OLE DB legacy 32-bit
|
|
**Nota**: Il processo sarà 32-bit — massima RAM ≈ 4GB.
|
|
|
|
---
|
|
|
|
### 3. Pubblicazione Linux x64
|
|
|
|
```powershell
|
|
dotnet publish Data_Coupler/Data_Coupler.csproj `
|
|
--configuration Release `
|
|
--runtime linux-x64 `
|
|
--self-contained true `
|
|
--output ./publish/linux-x64
|
|
```
|
|
|
|
**Attenzione**: OLE DB e ODBC (drivers Windows) **non sono supportati** su Linux.
|
|
Su Linux sono disponibili solo: SQL Server, MySQL, PostgreSQL, Oracle, SQLite, DB2, SAP HANA, REST API.
|
|
|
|
---
|
|
|
|
### 4. Pubblicazione macOS (Intel)
|
|
|
|
```powershell
|
|
dotnet publish Data_Coupler/Data_Coupler.csproj `
|
|
--configuration Release `
|
|
--runtime osx-x64 `
|
|
--self-contained true `
|
|
--output ./publish/osx-x64
|
|
```
|
|
|
|
---
|
|
|
|
### 5. Pubblicazione macOS (Apple Silicon - ARM64)
|
|
|
|
```powershell
|
|
dotnet publish Data_Coupler/Data_Coupler.csproj `
|
|
--configuration Release `
|
|
--runtime osx-arm64 `
|
|
--self-contained true `
|
|
--output ./publish/osx-arm64
|
|
```
|
|
|
|
---
|
|
|
|
## Pubblicazione Framework-Dependent (senza runtime incluso)
|
|
|
|
Se .NET 9 è già installato sul server target:
|
|
|
|
```powershell
|
|
# Windows (framework-dependent, lascia a .NET la scelta della bitness)
|
|
dotnet publish Data_Coupler/Data_Coupler.csproj `
|
|
--configuration Release `
|
|
--output ./publish/framework-dependent
|
|
|
|
# Forzare 32-bit anche in framework-dependent (per VFP):
|
|
# Compilare il progetto con PlatformTarget = x86 o usare --runtime win-x86
|
|
```
|
|
|
|
---
|
|
|
|
## Setup per Visual FoxPro (VFPOLEDB.1)
|
|
|
|
### Prerequisiti
|
|
|
|
1. **Driver VFPOLEDB installato** (32-bit):
|
|
- Download: [Microsoft OLE DB Provider for Visual FoxPro 9.0 SP2](https://www.microsoft.com/en-us/download/details.aspx?id=14839)
|
|
- Verifica installazione: `HKEY_CLASSES_ROOT\VFPOLEDB.1` deve esistere nel registro
|
|
|
|
2. **Applicazione pubblicata come 32-bit** (`--runtime win-x86`)
|
|
|
|
3. **Connection string esempio VFP**:
|
|
```
|
|
Provider=VFPOLEDB.1;Data Source=C:\VFP\Database\miodb.dbc;Collating Sequence=machine;
|
|
```
|
|
Per tabelle free (.dbf):
|
|
```
|
|
Provider=VFPOLEDB.1;Data Source=C:\VFP\Tabelle\;Collating Sequence=machine;
|
|
```
|
|
|
|
### Verifica Rapida in PowerShell
|
|
|
|
```powershell
|
|
# Verifica driver VFP installato
|
|
Get-Item "HKCR:\VFPOLEDB.1" -ErrorAction SilentlyContinue
|
|
|
|
# Verifica processo 32-bit in esecuzione
|
|
[System.Environment]::Is64BitProcess # deve restituire False
|
|
```
|
|
|
|
---
|
|
|
|
## Docker
|
|
|
|
Per Docker con VFP (non consigliato — driver COM Windows-only):
|
|
|
|
```dockerfile
|
|
# Nel Dockerfile, non è possibile usare VFPOLEDB su Linux container
|
|
# Usare Windows Container (opzione Dockerfile.windows)
|
|
```
|
|
|
|
Per **Windows Container** con supporto 32-bit, modifica il `Dockerfile.windows`:
|
|
|
|
```dockerfile
|
|
# Usa immagine Windows nano server
|
|
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
|
|
|
|
# Copia publish win-x86
|
|
COPY ./publish/win-x86 /app
|
|
```
|
|
|
|
---
|
|
|
|
## Riepilogo Rapido
|
|
|
|
| Scenario | Comando |
|
|
|---|---|
|
|
| Solo database SQL + REST API | `--runtime win-x64` |
|
|
| Visual FoxPro / OLE DB legacy | `--runtime win-x86` |
|
|
| Server Linux | `--runtime linux-x64` |
|
|
| macOS Intel | `--runtime osx-x64` |
|
|
| macOS Apple Silicon | `--runtime osx-arm64` |
|