Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Unlike the C++/Node siblings, this build has TWO stages: (1) build the native CAS BACnet
# Stack shared library from the stack submodule's C++ source with the stack's CMake, its
# only build (the windows-x64-dll preset on Windows, linux-x64-release-shared on Linux,
# then `cmake --install` into the submodule's bin/ - see README.md "Build the native CAS
# then `cmake --install` into the submodule's dist/ - see README.md "Build the native CAS
# BACnet Stack library"), then (2) `dotnet build -c Release` this project and copy that
# native library next to its output so the P/Invoke adapter can find it at run time. The
# C# adapter is compiled in place from submodules/cas-bacnet-stack/adapters/csharp/.
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "windows-x64-dll build failed" }
cmake --install build-windows-x64-dll --config Release
if ($LASTEXITCODE -ne 0) { throw "windows-x64-dll install failed" }
Get-ChildItem bin\CASBACnetStack_x64_Release.dll
Get-ChildItem dist\CASBACnetStack_x64_Release.dll

- name: Build the native CAS BACnet Stack library (Linux - CMake preset linux-x64-release-shared)
if: runner.os == 'Linux'
Expand All @@ -100,15 +100,15 @@ jobs:
cmake --preset linux-x64-release-shared
cmake --build --preset linux-x64-release-shared
cmake --install build-linux-x64-release-shared
ls -la bin/libCASBACnetStack_x64_Release.so
ls -la dist/libCASBACnetStack_x64_Release.so

- name: dotnet build (Release)
shell: bash
run: dotnet build -c Release

- name: Copy the native library next to the .NET output
shell: bash
run: cp "submodules/cas-bacnet-stack/bin/${{ matrix.nativelib }}" "${{ matrix.outdir }}/${{ matrix.nativelib }}"
run: cp "submodules/cas-bacnet-stack/dist/${{ matrix.nativelib }}" "${{ matrix.outdir }}/${{ matrix.nativelib }}"

- name: Smoke test + metrics (starts, binds, stays up; measures time to 'ready')
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ obj/
*.log

# The CAS BACnet Stack library is a BUILD ARTIFACT of the separately licensed stack, built
# from the submodule into submodules/cas-bacnet-stack/bin/ (README.md "Build the native CAS
# from the submodule into submodules/cas-bacnet-stack/dist/ (README.md "Build the native CAS
# BACnet Stack library") and copied by the .csproj only into the gitignored build output
# (bin/Release/net8.0/). It is never committed or released from this repository - whatever
# its name or platform.
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ windows-x64-dll`, `cmake --build --preset windows-x64-dll-release`, `cmake
`linux-x64-release-shared` preset on Linux) - a customer-interface build,
never the test-tool library. The stack no longer has `projects/msvs/` or
`projects/linux/` (removed before `6.x` @ `29b83de6`). See README.md for the
exact commands. `cmake --install` puts the library in the submodule's `bin/`;
exact commands. `cmake --install` puts the library in the submodule's `dist/`;
the `.csproj` copies it from there into the
build output when it exists there. Do not try to fold that into the `.csproj` as a
pre-build target unless you also make it a no-op when the DLL/.so is already
Expand Down
10 changes: 5 additions & 5 deletions BACnetProfileExampleBSSCS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
<!-- The native CAS BACnet Stack library the adapter P/Invokes, copied next to the build
output when it has been built (README "Build the native CAS BACnet Stack library":
the stack's CMake DLL preset, then "cmake [double-dash]install build-<preset>", writes it to the
submodule's bin/). Absent = nothing copied. The copy lands only in the gitignored
submodule's dist/). Absent = nothing copied. The copy lands only in the gitignored
build output (bin/); the stack binary is never committed or released. -->
<None Include="submodules/cas-bacnet-stack/bin/CASBACnetStack_x64_Release.dll"
Condition="Exists('submodules/cas-bacnet-stack/bin/CASBACnetStack_x64_Release.dll')"
<None Include="submodules/cas-bacnet-stack/dist/CASBACnetStack_x64_Release.dll"
Condition="Exists('submodules/cas-bacnet-stack/dist/CASBACnetStack_x64_Release.dll')"
Link="CASBACnetStack_x64_Release.dll" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Never" Visible="false" />
<None Include="submodules/cas-bacnet-stack/bin/libCASBACnetStack_x64_Release.so"
Condition="Exists('submodules/cas-bacnet-stack/bin/libCASBACnetStack_x64_Release.so')"
<None Include="submodules/cas-bacnet-stack/dist/libCASBACnetStack_x64_Release.so"
Condition="Exists('submodules/cas-bacnet-stack/dist/libCASBACnetStack_x64_Release.so')"
Link="libCASBACnetStack_x64_Release.so" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Never" Visible="false" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to

## [Unreleased]

### Changed

- Updated to CAS BACnet Stack 6.x `83e04a2d` (6.1.2, 2026-12-02).
- The stack library is now found in the submodule's `dist/` folder, where 6.1.2's `cmake --install` puts it (it was `bin/`). The CI workflow, the run-time search and the build instructions all use `dist/`.

## [1.2.1] - 2026-11-02

Built on CAS BACnet Stack 6.x (`1e7dffe2b`).
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ The C# adapter's P/Invoke declarations resolve
`CASBACnetStack_x64_Release.dll` (Windows) / `libCASBACnetStack_x64_Release.so`
(Linux) from the process's own directory (or the system library search path)
at run time - there is no bundled copy and no NuGet package. **Build it yourself
from the stack submodule**: it lands in `submodules/cas-bacnet-stack/bin/`, and
from the stack submodule**: it lands in `submodules/cas-bacnet-stack/dist/`, and
`dotnet build` copies it from there into this project's build output.

**The stack library is never committed to this repository and never released.**
Expand Down Expand Up @@ -271,7 +271,7 @@ in the submodule; its README's "Building and testing" and AGENTS.md
"Building" list the presets). Each preset builds into
`submodules/cas-bacnet-stack/build-<preset>/` (ignored by the stack's own
`.gitignore`), and `cmake --install build-<preset>` copies the library into
the submodule's `bin/`, under exactly the name the adapter loads. It is a
the submodule's `dist/`, under exactly the name the adapter loads. It is a
customer-interface build (no test-tool exports; `CASBACNET_LIBRARY_TESTTOOL`
is off by default). Run the commands from the submodule's folder, because
`cmake --preset` reads `CMakePresets.json` from the current directory.
Expand All @@ -284,10 +284,10 @@ Visual Studio 2022). PowerShell or a Developer Prompt:
cd submodules\cas-bacnet-stack
cmake --preset windows-x64-dll
cmake --build --preset windows-x64-dll-release
cmake --install build-windows-x64-dll --config Release # -> bin\CASBACnetStack_x64_Release.dll
cmake --install build-windows-x64-dll --config Release # -> dist\CASBACnetStack_x64_Release.dll
cd ..\..

dotnet build -c Release # copies submodules\cas-bacnet-stack\bin\CASBACnetStack_x64_Release.dll next to the .exe
dotnet build -c Release # copies submodules\cas-bacnet-stack\dist\CASBACnetStack_x64_Release.dll next to the .exe
```

The install step copies the DLL only: its import library has the stack's
Expand All @@ -299,14 +299,14 @@ static-library name and stays in the build tree.
cd submodules/cas-bacnet-stack
cmake --preset linux-x64-release-shared
cmake --build --preset linux-x64-release-shared
cmake --install build-linux-x64-release-shared # -> bin/libCASBACnetStack_x64_Release.so
cmake --install build-linux-x64-release-shared # -> dist/libCASBACnetStack_x64_Release.so
cd ../..

dotnet build -c Release # copies it next to the executable
```

The `.csproj` copies the DLL (or `libCASBACnetStack_x64_Release.so`) from the
submodule's `bin/` into the build output whenever it exists there, so build the
submodule's `dist/` into the build output whenever it exists there, so build the
native library first and `dotnet build` second. Either way it lands in the
same directory as `BACnetProfileExampleBSSCS.dll`/`.exe`
(`bin/Release/net8.0/`, gitignored) - the .NET native-library resolver looks
Expand Down
4 changes: 2 additions & 2 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ defect, not a feature.

| Symptom | Cause / fix |
|---------|-------------|
| `ERROR: This example cannot run without the CAS BACnet Stack library.` (exit code 1) | The CAS BACnet Stack library (`CASBACnetStack_x64_Release.dll` / `libCASBACnetStack_x64_Release.so`) is not in the folder that holds the executable - the "Looked in" line names it. A release never includes it: it is a commercially licensed (paid) library from Chipkin (<https://store.chipkin.com/contact-us>). Licensed customers build it from the submodule (README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library)) and put it next to the executable; a source build's `dotnet build -c Release` copies it there from `submodules/cas-bacnet-stack/bin/`. |
| `ERROR: This example cannot run without the CAS BACnet Stack library.` (exit code 1) | The CAS BACnet Stack library (`CASBACnetStack_x64_Release.dll` / `libCASBACnetStack_x64_Release.so`) is not in the folder that holds the executable - the "Looked in" line names it. A release never includes it: it is a commercially licensed (paid) library from Chipkin (<https://store.chipkin.com/contact-us>). Licensed customers build it from the submodule (README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library)) and put it next to the executable; a source build's `dotnet build -c Release` copies it there from `submodules/cas-bacnet-stack/dist/`. |
| The same message followed by `Details: ...` | The library file is there but could not be loaded: the wrong architecture (this build is x64), a missing dependency, or a damaged file. The `Details` line is the runtime's reason. |
| `DllNotFoundException: Unable to load DLL 'CASBACnetStack_x64_Release'` | The native library is missing from the build output directory. See README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library) - it is a separate step from `dotnet build`: build it from the submodule into `submodules/cas-bacnet-stack/bin/`, then run `dotnet build -c Release` again, which copies it next to `BACnetProfileExampleBSSCS.dll`/`.exe`. |
| `DllNotFoundException: Unable to load DLL 'CASBACnetStack_x64_Release'` | The native library is missing from the build output directory. See README.md [Build the native CAS BACnet Stack library](README.md#build-the-native-cas-bacnet-stack-library) - it is a separate step from `dotnet build`: build it from the submodule into `submodules/cas-bacnet-stack/dist/`, then run `dotnet build -c Release` again, which copies it next to `BACnetProfileExampleBSSCS.dll`/`.exe`. |
| `DllNotFoundException` mentioning `CASBACnetStack_x64_Debug` | You built/ran in `Debug` configuration. The stack's CMake DLL presets build only the Release library (`CASBACnetStack_x64_Release`) - see README.md [Why only a Release build](README.md#why-only-a-release-build). Build and run with `-c Release`. |
| `BadImageFormatException` | The native library's architecture does not match this process. This example targets `x64` (`<PlatformTarget>x64</PlatformTarget>`) - make sure the DLL/.so you built is also x64. |
| `System.InvalidOperationException` from `Console.KeyAvailable` | Should not happen - `CASExampleHelper.PollKey()` checks `Console.IsInputRedirected` first and reads a redirected stdin on a background thread instead. If you see this after a local edit, you likely removed that check; see [Interactive keys are a simplification](#interactive-keys-are-a-simplification). |
Expand Down
2 changes: 1 addition & 1 deletion submodules/cas-bacnet-stack
Loading