ResourceLoader 3.4.2-pre

This is a prerelease version of ResourceLoader.
dotnet add package ResourceLoader --version 3.4.2-pre
                    
NuGet\Install-Package ResourceLoader -Version 3.4.2-pre
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ResourceLoader" Version="3.4.2-pre" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ResourceLoader" Version="3.4.2-pre" />
                    
Directory.Packages.props
<PackageReference Include="ResourceLoader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ResourceLoader --version 3.4.2-pre
                    
#r "nuget: ResourceLoader, 3.4.2-pre"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ResourceLoader@3.4.2-pre
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ResourceLoader&version=3.4.2-pre&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ResourceLoader&version=3.4.2-pre&prerelease
                    
Install as a Cake Tool

ResourceLoader

Version Downloads

<img src="https://raw.githubusercontent.com/thomasgalliker/ResourceLoader/develop/logo.png" width="100" height="100" alt="ResourceLoader" align="right"> ResourceLoader is a utility for reading embedded resources, such as XML files, images, etc. from assemblies.

Download and Install ResourceLoader

This library is available on NuGet: https://www.nuget.org/packages/ResourceLoader/ Use the following command to install ResourceLoader using NuGet package manager console:

PM> Install-Package ResourceLoader

You can use this library in any .Net project which is compatible to PCL (e.g. Xamarin Android, iOS, Windows Phone, Windows Store, Universal Apps, etc.)

API Usage

Reading an embedded XML file

The following unit test shows how an XML file (XMLFile1.xml) can be read from the current assembly.

// Arrange
IResourceLoader resourceLoader = new ResourceLoader();

// Act
string embeddedResourceString = resourceLoader.GetEmbeddedResourceString(this.GetType().Assembly, "XMLFile1.xml");

// Assert
embeddedResourceString.Should().NotBeNull();
embeddedResourceString.Should().Be(@"<?xml version=""1.0"" encoding=""utf-8"" ?>");
Using singleton implementation ResourceLoader.Current

If you do not use an IoC framework, you can call ResourceLoader.Current directly to get a singleton instance of IResourceLoader.

string embeddedResourceString = ResourceLoader.Current.GetEmbeddedResourceString(this.GetType().Assembly, "XMLFile1.xml");

License

This project is Copyright © 2018 Thomas Galliker. Free for non-commercial use. For commercial use please contact the author.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.2 is compatible.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 1.2

  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ResourceLoader:

Repository Stars
thomasgalliker/CameraScanner.Maui
Camera preview and barcode scanner for .NET MAUI apps
Version Downloads Last Updated
3.4.2-pre 418 12/10/2025
3.3.3-pre 450 3/12/2025
3.3.2-pre 4,577 6/22/2024
3.3.1 26,065 1/7/2024
3.3.0-pre 398 1/7/2024
3.2.8-pre 950 1/9/2022
3.2.7-pre 798 11/12/2021
3.2.5-pre 817 8/30/2021
3.2.4 57,207 8/25/2021
3.2.3-pre 840 8/25/2021
3.1.20095.1 19,463 4/4/2020
3.1.19310.1-pre 1,088 11/6/2019
3.1.19095.1-pre 2,395 4/5/2019
3.1.18322.1 5,754 11/18/2018
3.1.18282.1 3,368 10/9/2018
2.0.6 4,525 6/8/2017
2.0.5 5,162 7/25/2016
2.0.4 3,716 7/25/2016
2.0.3 3,916 4/27/2016
2.0.2 6,075 4/23/2016
2.0.1 3,889 4/23/2016
2.0.0 3,718 4/21/2016
1.0.2 3,759 4/19/2016

3.4
- Add support for nullable reference types.
- Maintenance updates.

3.3
- Maintenance updates.

3.2
- Maintenance updates.

3.1
- Maintenance updates.

3.0
- Add support for .NET Standard.

2.0.6
- Added assembly versioning.

2.0.5
- Added new methods to IResourceLoader to find multiple resources matching the given file pattern.
     
2.0.3
- Added text encoding parameter to GetEmbeddedResourceString.
     
2.0.2
- New exception of type MultipleResourcesFoundException if more than one resource matches the given name.
- New exception of type ResourceNotFoundException if resource could not be found.

2.0.0
- Refactored to provide non-static implementation of ResourceLoader.
- New IResourceLoader interface as abstraction for ResourceLoader.
- Static access to IResourceLoader via ResourceLoader.Current.

1.0.2
- Initial release.