Skip to content

Commit 4d68c93

Browse files
committed
Download .net 4.0 for B2SServerPluginInterface
1 parent b495580 commit 4d68c93

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ msbuild [solution].sln /t:Clean /p:Configuration=Debug /p:UICulture=en-US
8080

8181
### Validation Steps
8282
- All builds complete without errors (warnings are acceptable)
83-
- Generated executables appear in respective `bin/Debug` or `bin/x86/Debug` directories
83+
- Generated executables appear in the respective `bin/Debug` or `bin/Release` directories (Any CPU output)
8484
- B2SServerPluginInterface.dll must exist in `b2sbackglassserver/b2sbackglassserver/Plugin/` before building main server
8585
- No unit tests exist in this repository
8686

8787
## Project Architecture
8888

8989
### Main Components
90-
1. **b2sbackglassserver/** - Core COM server (DLL) and standalone executable (EXE)
90+
1. **b2sbackglassserver/** - Core COM server (DLL) and standalone executable (EXE) (the DLL calls the EXE depending on the configuration)
9191
- `B2SBackglassServer.vbproj` - COM server library
9292
- `B2SBackglassServerEXE.vbproj` - Standalone executable
9393
- Key files: `Server.vb`, `Classes/B2SVersionInfo.vb`
@@ -123,6 +123,7 @@ msbuild [solution].sln /t:Clean /p:Configuration=Debug /p:UICulture=en-US
123123
- Builds all configurations (Debug/Release) using Any CPU platform
124124
- Automatically updates version numbers from VB version constants
125125
- Creates release artifacts with all executables and documentation
126+
- Installs the .NET 4.0 developer pack and restores `Microsoft.NETFramework.ReferenceAssemblies.net40` via NuGet so the plugin can compile
126127
- **Prerelease workflow**: `.github/workflows/prerelease.yml` for tagged releases
127128

128129
### Development Notes
@@ -145,6 +146,7 @@ msbuild [solution].sln /t:Clean /p:Configuration=Debug /p:UICulture=en-US
145146

146147
### Common Issues and Workarounds
147148
- **Missing B2SServerPluginInterface.dll**: Always build this dependency first from the external repository
149+
- **B2SServerPluginInterface target**: The upstream project still targets .NET Framework 4.0; install the .NET 4.0 Developer Pack before building it locally
148150
- **Build configuration**: All projects now use "Any CPU" platform consistently
149151
- **Build order**: Some projects may have undocumented dependencies - build in the order listed above
150152
- **German build messages**: On German Windows systems, MSBuild may still show German messages even with `/p:UICulture=en-US`. The builds work correctly - focus on "Fehler" (errors) and "Warnung" (warnings) counts at the end

.github/workflows/b2s-backglass.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ jobs:
2525
with:
2626
repository: DirectOutput/B2SServerPluginInterface
2727
path: B2SServerPluginInterface
28-
# Since the file is in the DirectOutput repository, we try to patch it here
29-
- name: Patch B2SServerPluginInterface.csproj to use .NET Framework 4.8
28+
- name: Setup NuGet
29+
uses: NuGet/setup-nuget@v2
30+
- name: Restore .NET 4 reference assemblies
3031
shell: pwsh
3132
run: |
32-
$csproj = "B2SServerPluginInterface/B2SServerPluginInterface/B2SServerPluginInterface.csproj"
33-
(Get-Content $csproj) -replace '<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>', '<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>' | Set-Content $csproj
34-
$docProj = "B2SServerPluginInterface/Documentation/Documentation.csproj"
35-
(Get-Content $docProj) -replace '<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>', '<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>' | Set-Content $docProj
36-
(Get-Content $docProj) -replace '<TargetFrameworkProfile>Client</TargetFrameworkProfile>', '' | Set-Content $docProj
37-
33+
& "$env:ChocolateyInstall\bin\nuget.exe" install Microsoft.NETFramework.ReferenceAssemblies.net40 -Version 1.0.3 -OutputDirectory packages
34+
$packageRoot = Join-Path $PWD 'packages/Microsoft.NETFramework.ReferenceAssemblies.net40.1.0.3'
35+
$nupkg = Join-Path $packageRoot 'Microsoft.NETFramework.ReferenceAssemblies.net40.1.0.3.nupkg'
36+
if (Test-Path $nupkg) {
37+
Expand-Archive -LiteralPath $nupkg -DestinationPath $packageRoot -Force
38+
}
3839
- id: version
3940
name: Update AssemblyInformationalVersion
4041
run: |
@@ -87,9 +88,10 @@ jobs:
8788
echo "tag=${VERSION_LONG}" >> $GITHUB_OUTPUT
8889
- uses: microsoft/setup-msbuild@v2
8990
- name: Build B2SServerPluginInterface
91+
shell: pwsh
9092
run: |
91-
msbuild B2SServerPluginInterface/B2SServerPluginInterface.sln /t:Rebuild /p:Configuration=${{ matrix.config }}
92-
shell: cmd
93+
$frameworkPath = Resolve-Path packages/Microsoft.NETFramework.ReferenceAssemblies.net40.1.0.3/build/.NETFramework/v4.0
94+
msbuild B2SServerPluginInterface/B2SServerPluginInterface.sln /t:Rebuild /p:Configuration=${{ matrix.config }} /p:FrameworkPathOverride="$frameworkPath"
9395
- run: |
9496
cp B2SServerPluginInterface/B2SServerPluginInterface/bin/${{ matrix.config }}/B2SServerPluginInterface.dll b2sbackglassserver/b2sbackglassserver/Plugin
9597
if [[ "${{ matrix.config }}" == "Debug" ]]; then
Binary file not shown.

0 commit comments

Comments
 (0)