dotnet add package nanoFramework.CoreLibrary --version 1.15.5
NuGet\Install-Package nanoFramework.CoreLibrary -Version 1.15.5
<PackageReference Include="nanoFramework.CoreLibrary" Version="1.15.5" />
paket add nanoFramework.CoreLibrary --version 1.15.5
#r "nuget: nanoFramework.CoreLibrary, 1.15.5"
// Install nanoFramework.CoreLibrary as a Cake Addin #addin nuget:?package=nanoFramework.CoreLibrary&version=1.15.5 // Install nanoFramework.CoreLibrary as a Cake Tool #tool nuget:?package=nanoFramework.CoreLibrary&version=1.15.5
Welcome to the .NET nanoFramework Base Class Library repository
|Component||Build Status||NuGet Package|
|Base Class Library|
|Base Class Library w/o reflection|
The .NET nanoFramework Base Class Library is provided in two flavours: with or without support for System.Reflection namespace. The reason for this is that the reflection API adds up a significant size to the DLL and image size. For targets with smaller flash this can be prohibitive.
nanoFramework has a dedicated Unit Test framework. This repository has Unit Test and you will find all of them under the
Tests folder. The main solution embed all all the tests as well. You can run them directly from Visual Studio and create new tests. For more information on the Unit Test Framework.
CoreLibrary has specific needs that differ from what you'll find in the documentation:
- You need to have the nanoFramework.TestFramework as a NuGet package as it will bring the nanoCLR Win32 emulator
- You need to remove the reference to mscorlib, nanoFramework.TestFramework and nanoFramework.UnitTestLauncher
- Use project reference instead for all those 3 elements
You can then run the test either on a real device, either in the emulator as described in the documentation. You may have to manually flash your device for the mscorlib version to match the one you are building on.
Important: Any new code checked in this repository will have to:
- have a proper test covering for all the methods, properties, events and the possible exceptions,
- do not break more of the the existing tests meaning, in other words, it should not create more issues than already existing.
Test structure and project reference
All the projects are referenced based and to be able to run the tests in the pipeline, in command line and in Visual Studio, it does require a specific structure:
NFUnitTestAdapterproject must be present and untouched. It does contains the core elements needed to have the nanoCLR Win32 application present.
- You need to have a
nano.runsettingsfile in each sub directory you want to run the tests on from Visual Studio
- If you want to run the tests in command line you have to use the
Developer Command Prompt for VS 2019then you can use from the home cloned lib-CoreLibrary directory a command line like this one:
vstest.console.exe .\Tests\NFUnitTestBitConverter\bin\Release\NFUnitTest.dll /Settings:.\Tests\NFUnitTestAdapater\nano.runsettings /TestAdapterPath:.\nanoFramework.TestFramework\source\TestAdapter\bin\Debug\net4.8 /Diag:.\log.txt /Logger:trx
- You have to build the TestAdapter from the source in this case. You can use the path to the NuGet as well, this will have the same effect.
- you have full diagnostic enabled in this case.
Feedback and documentation
For documentation, providing feedback, issues and finding out how to contribute please refer to the Home repo.
Join our Discord community here.
The list of contributors to this project can be found at CONTRIBUTORS.
The nanoFramework Class Libraries are licensed under the MIT license.
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.
This project is supported by the .NET Foundation.
|Product||Versions Compatible and additional computed target framework versions.|
|.NET Framework||net is compatible.|
This package has no dependencies.
NuGet packages (316)
Showing the top 5 NuGet packages that depend on nanoFramework.CoreLibrary:
This package includes the nanoFramework.Runtime.Events assembly for nanoFramework C# projects. This package requires a target with nanoFramework.Runtime.Events v220.127.116.11 (checksum 0x0EAB00C9).
This package includes the System.Device.I2c assembly for nanoFramework C# projects. This package requires a target with System.Device.I2c v18.104.22.168 (checksum 0xFA806D33).
This package includes the nanoFramework.System.Math assembly for .NET nanoFramework C# projects. This package requires a target with System.Math v22.214.171.124 (checksum 0x9F9E2A7E).
This package includes the System.Device.Gpio assembly for .NET nanoFramework C# projects. This package requires a target with System.Device.Gpio v126.96.36.199 (checksum 0x097E7BC5).
Adds Temperature units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.
GitHub repositories (5)
Showing the top 5 popular GitHub repositories that depend on nanoFramework.CoreLibrary:
Sample code referenced by the .NET documentation
Makes life working with units of measurement just a little bit better.
AMQP 1.0 .NET Library
🍬 Code samples from the nanoFramework team used in testing, proof of concepts and other explorational endeavours
📦 This repo includes .NET nanoFramework implementations for various sensors, chips, displays, hats and drivers