140 lines
4.4 KiB
Markdown
140 lines
4.4 KiB
Markdown
# Minimal Machine Setup (CLI-Only, No Visual Studio)
|
|
|
|
This project can be developed with a small footprint:
|
|
- .NET SDK only (`dotnet --version` should work)
|
|
- PowerShell
|
|
- No Visual Studio required
|
|
|
|
## Why This Exists
|
|
|
|
This repo uses NuGet package references. The helper script keeps all dotnet and
|
|
NuGet artifacts local to this repo, clears proxy env vars for each command, and
|
|
uses restore flags that tolerate offline/unreachable remote sources.
|
|
This keeps footprint small and avoids host-level environment drift.
|
|
|
|
Current status target:
|
|
- `./scripts/dotnet-min.ps1 restore ...` succeeds in this workspace.
|
|
- If remote NuGet TLS is flaky, restores still work when package cache is present.
|
|
|
|
## One-Time Check
|
|
|
|
```powershell
|
|
dotnet --version
|
|
./scripts/dotnet-min.ps1 --info
|
|
```
|
|
|
|
## Standard Workflow
|
|
|
|
Run commands from `journal-master/journal`:
|
|
|
|
```powershell
|
|
./scripts/dotnet-min.ps1 restore Journal.Sidecar/Journal.Sidecar.csproj
|
|
./scripts/dotnet-min.ps1 restore Journal.Api/Journal.Api.csproj
|
|
./scripts/dotnet-min.ps1 build Journal.Core/Journal.Core.csproj
|
|
./scripts/dotnet-min.ps1 build Journal.Sidecar/Journal.Sidecar.csproj
|
|
./scripts/dotnet-min.ps1 build Journal.Api/Journal.Api.csproj
|
|
./scripts/dotnet-min.ps1 run --project Journal.SmokeTests/Journal.SmokeTests.csproj
|
|
```
|
|
|
|
## If Restore Fails In A New Shell
|
|
|
|
Quick checks:
|
|
|
|
```powershell
|
|
./scripts/dotnet-min.ps1 nuget list source
|
|
./scripts/dotnet-min.ps1 restore Journal.Sidecar/Journal.Sidecar.csproj
|
|
```
|
|
|
|
If your shell has proxy env vars set, the helper script already clears them per run.
|
|
It also applies:
|
|
- `--ignore-failed-sources` on restore
|
|
- `-p:RestoreIgnoreFailedSources=true`
|
|
- `-p:NuGetAudit=false`
|
|
|
|
## Admin TLS Repair Attempt (Host-Level)
|
|
|
|
These commands must be run in an **Administrator PowerShell** outside this agent session.
|
|
|
|
1. Backup the current key:
|
|
|
|
```powershell
|
|
reg export "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders" "$env:USERPROFILE\Desktop\SecurityProviders_backup.reg" /y
|
|
```
|
|
|
|
2. Restore standard provider list for Schannel:
|
|
|
|
```powershell
|
|
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders" /v SecurityProviders /t REG_SZ /d "credssp.dll, schannel.dll, digest.dll, msnsspc.dll" /f
|
|
```
|
|
|
|
3. Backup and repair LSA security packages (required if `SEC_E_NO_CREDENTIALS` persists):
|
|
|
|
```powershell
|
|
reg export "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" "$env:USERPROFILE\Desktop\Lsa_backup.reg" /y
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "Security Packages" -Type MultiString -Value @("kerberos","msv1_0","schannel","wdigest","tspkg","pku2u")
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "Authentication Packages" -Type MultiString -Value @("msv1_0")
|
|
```
|
|
|
|
4. Reboot, then test:
|
|
|
|
```powershell
|
|
curl.exe -I https://api.nuget.org/v3/index.json
|
|
./scripts/dotnet-min.ps1 restore Journal.Sidecar/Journal.Sidecar.csproj
|
|
```
|
|
|
|
5. If still broken, run system repair and reboot:
|
|
|
|
```powershell
|
|
DISM /Online /Cleanup-Image /RestoreHealth
|
|
sfc /scannow
|
|
```
|
|
|
|
## Friend Machine Export -> This Machine Import (Offline NuGet Cache)
|
|
|
|
Use this when your friend can restore packages on a healthy machine.
|
|
|
|
On friend machine (from `journal-master/journal`):
|
|
|
|
```powershell
|
|
./scripts/nuget-export-cache.ps1 -OutputZip .\nuget-cache-export.zip
|
|
```
|
|
|
|
Copy `nuget-cache-export.zip` to this machine, then from `journal-master/journal`:
|
|
|
|
```powershell
|
|
./scripts/nuget-import-cache.ps1 -InputZip .\nuget-cache-export.zip
|
|
```
|
|
|
|
If restore still reports remote source errors after import, run one more pass:
|
|
|
|
```powershell
|
|
./scripts/dotnet-min.ps1 restore Journal.Sidecar/Journal.Sidecar.csproj --ignore-failed-sources
|
|
./scripts/dotnet-min.ps1 build Journal.Sidecar/Journal.Sidecar.csproj
|
|
```
|
|
|
|
### What the export/import scripts do
|
|
|
|
- `nuget-export-cache.ps1`
|
|
- runs restores to prime cache
|
|
- bundles `.nuget/` into a zip
|
|
- writes a small manifest file in the bundle
|
|
- `nuget-import-cache.ps1`
|
|
- expands the bundle into this repo
|
|
- runs restores against local cache
|
|
|
|
## Local Footprint Paths
|
|
|
|
The helper script keeps artifacts under this repo:
|
|
- `.dotnet_home/`
|
|
- `.nuget/packages/`
|
|
- `.nuget/http-cache/`
|
|
- normal build outputs (`bin/`, `obj/`)
|
|
|
|
To clean everything created for this machine:
|
|
|
|
```powershell
|
|
Remove-Item -Recurse -Force .dotnet_home,.nuget -ErrorAction SilentlyContinue
|
|
Get-ChildItem -Recurse -Directory -Filter bin | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
|
Get-ChildItem -Recurse -Directory -Filter obj | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
|
```
|