-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileNotFoundException for 'SEALNet' assembly when running Dockerized .NET app on Debian 11 (i.MX8) #677
Comments
I know this is a late answer, but I stumbled upon the same issue on my Apple Silicon Macs and any ARM-based Docker images, it seems like the issue is present on ARM instruction set systems. So maybe this answer can help someone who is running into the same issue. One solution for Apple Silicon is to run the app dockerised with an amd64 build, thanks to the x86/ARM translation layer macOS provides (i.e the If that is not an option (i.e. on the i.MX8 processor mentioned here?) I managed to get it working locally by following the building SEAL instructions in the README.md and making some minor adjustments. First you need to make sure to build the SEAL_C wrapper library for C# by running the following commands: cmake -S . -B build -DSEAL_BUILD_SEAL_C=ON && \
cmake --build build Now that the build folder contains the shared library and the C# find ./build/dotnet -name "*csproj*" -exec sed -i '' '/<PlatformTarget>x64/d' {} \; && \
find ./build/dotnet -name "*csproj*" -exec sed -i '' 's/net6.0/net8.0/g' {} \; && \
find ./build/dotnet -name "*nuspec*" -exec sed -i '' 's/macos-x64/osx-arm64/g' {} \; && \
find ./build/dotnet -name "*nuspec*" -exec sed -i '' 's/linux-x64/linux-arm64/g' {} \; Next you can run the Building .NET Components instructions as usual: dotnet build build/dotnet/src --configuration Release && \
dotnet test build/dotnet/tests; Make sure that everything runs and no FileNotFoundException occurs. Now the built SEALNet.dll is ready to be used in your project, sadly I haven't found a way to get <Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy
SourceFiles="<Path to SEAL>/SEAL/build/lib/<Matching lib file>"
DestinationFolder="$(TargetDir)"
/>
</Target> Lastly, you can run dotnet add reference /path/to/seal/SEAL/build/dotnet/src/SEALNet.csproj This did the trick for me, I haven't tested this on Linux but it does work on Apple Silicon running macOS. I know it is a bit hacky but I don't have the C# and Nuget expertise to make SEAL build and package for ARM systems as well as x86 ones. But I hope this can provide some guidance to people running into the same issue to devise a better way to fix this issue. |
Environment
Issue Description
I am encountering a
FileNotFoundException
when attempting to run a dockerized .NET application that utilizes the Microsoft SEAL library. This issue is occurring specifically on an i.MX8 device running Debian 11, and I'm constrained to this OS for various reasons.The exact error message is as follows:
** Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'SEALNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. **
This error is thrown immediately when attempting to run the application with Dockerfile, the csproj file has the correct Microsoft.Reasearch.SEALNet package. It works for dockerized application in an ubuntu22.04 machine, not for imx8 debian11 dockerized application.
Reproduction Steps
FileNotFoundException
upon executingdotnet publish -c Debug -o out
.Dockerfile :
Any insights or suggestions on how to resolve this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: