Shiny.Permissions.MSBuild 1.0.0-beta-0009

Prefix Reserved
This is a prerelease version of Shiny.Permissions.MSBuild.
dotnet add package Shiny.Permissions.MSBuild --version 1.0.0-beta-0009
                    
NuGet\Install-Package Shiny.Permissions.MSBuild -Version 1.0.0-beta-0009
                    
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="Shiny.Permissions.MSBuild" Version="1.0.0-beta-0009" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shiny.Permissions.MSBuild" Version="1.0.0-beta-0009" />
                    
Directory.Packages.props
<PackageReference Include="Shiny.Permissions.MSBuild" />
                    
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 Shiny.Permissions.MSBuild --version 1.0.0-beta-0009
                    
#r "nuget: Shiny.Permissions.MSBuild, 1.0.0-beta-0009"
                    
#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 Shiny.Permissions.MSBuild@1.0.0-beta-0009
                    
#: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=Shiny.Permissions.MSBuild&version=1.0.0-beta-0009&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Shiny.Permissions.MSBuild&version=1.0.0-beta-0009&prerelease
                    
Install as a Cake Tool

Shiny Permissions MSBuild

An MSBuild task library that automatically generates Android manifest permissions/features and iOS Info.plist entries during the build process. Declare permissions in your project file and the correct platform-specific XML is generated for you.

Installation

Install the NuGet package:

dotnet add package Shiny.Permissions.MSBuild

Once installed, the .props and .targets files are imported automatically. Generation runs before the Build target and only when items are defined.

MAUI Permissions

The simplest way to declare permissions for a .NET MAUI app. Add MauiPermission items and the task generates both Android manifest entries and iOS Info.plist entries automatically:

<ItemGroup>
    <MauiPermission Include="Camera" />
    <MauiPermission Include="BluetoothLE" />
    <MauiPermission Include="Location" />
    <MauiPermission Include="Push" />
    <MauiPermission Include="Biometric" />
    <MauiPermission Include="Contacts" />
</ItemGroup>

Known Permission Sets

Permission Android Permissions iOS Entries
BluetoothLE BLUETOOTH, BLUETOOTH_ADMIN, BLUETOOTH_CONNECT, BLUETOOTH_SCAN, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION UIBackgroundModes (bluetooth-central), NSBluetoothAlwaysUsageDescription
Location ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION + features: LOCATION.GPS, LOCATION.NETWORK UIBackgroundModes (location), NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription
LocationBackground FOREGROUND_SERVICE_LOCATION, FOREGROUND_SERVICE, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION + features: LOCATION.GPS, LOCATION.NETWORK UIBackgroundModes (location), NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription
Geofencing ACCESS_BACKGROUND_LOCATION, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION + features: LOCATION.GPS, LOCATION.NETWORK UIBackgroundModes (location), NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription
Push POST_NOTIFICATIONS UIBackgroundModes (remote-notification)
Microphone RECORD_AUDIO NSMicrophoneUsageDescription
Contacts READ_CONTACTS NSContactsUsageDescription
Calendar READ_CALENDAR NSCalendarsUsageDescription
Camera CAMERA NSCameraUsageDescription
Photos READ_EXTERNAL_STORAGE NSPhotoLibraryUsageDescription
Maps ACCESS_FINE_LOCATION NSLocationWhenInUseUsageDescription
Biometric USE_BIOMETRIC NSFaceIDUsageDescription

Deduplication and Merging

When multiple permission sets share entries, the generator automatically:

  • Deduplicates Android permissions and features (e.g. BluetoothLE + Location both declare ACCESS_FINE_LOCATION — it appears only once)
  • Merges iOS array entries (e.g. BluetoothLE + Location + Push merge into a single UIBackgroundModes array with bluetooth-central, location, and remote-notification)

Output

MauiPermission items generate two files in $(IntermediateOutputPath):

File Description
AndroidManifest.xml Android permissions and features
Info.plist iOS Info.plist entries

Android Manifest Permissions

For fine-grained control, add AndroidManifestPermission items directly:

<ItemGroup>
  <AndroidManifestPermission Include="CAMERA" />
  <AndroidManifestPermission Include="ACCESS_FINE_LOCATION" />
  <AndroidManifestPermission Include="READ_EXTERNAL_STORAGE" MaxSdkVersion="32" />
  <AndroidManifestPermission Include="WRITE_EXTERNAL_STORAGE" MinSdkVersion="19" MaxSdkVersion="28" />
</ItemGroup>

This generates $(IntermediateOutputPath)AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:minSdkVersion="19" android:maxSdkVersion="28" />
</manifest>

Metadata

Metadata Required Description
MinSdkVersion No Minimum Android SDK version for this permission
MaxSdkVersion No Maximum Android SDK version for this permission

Name Resolution

Short names like CAMERA are automatically prefixed with android.permission.. Fully qualified names with 3+ dot-separated segments (e.g. com.example.myapp.CUSTOM_PERMISSION) are used as-is.

Android Manifest Features

Add AndroidManifestFeature items to your project file:

<ItemGroup>
  <AndroidManifestFeature Include="CAMERA" />
  <AndroidManifestFeature Include="LOCATION.GPS" Required="true" />
  <AndroidManifestFeature Include="BLUETOOTH" Required="false" />
</ItemGroup>

This generates $(IntermediateOutputPath)AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-feature android:name="android.hardware.CAMERA" />
    <uses-feature android:name="android.hardware.LOCATION.GPS" android:required="true" />
    <uses-feature android:name="android.hardware.BLUETOOTH" android:required="false" />
</manifest>

Metadata

Metadata Required Description
Required No Whether the feature is required (true or false)

Name Resolution

Short names like CAMERA are automatically prefixed with android.hardware.. Fully qualified names with 3+ dot-separated segments are used as-is.

iOS Info.plist Entries

Add InfoPlistPermission items to your project file:

<ItemGroup>
  
  <InfoPlistPermission Include="NSCameraUsageDescription" Type="string" Value="We need camera access for video calls" />
  <InfoPlistPermission Include="NSLocationWhenInUseUsageDescription" Type="string" Value="Your location helps us find nearby places" />

  
  <InfoPlistPermission Include="UIRequiresPersistentWiFi" Type="boolean" Value="true" />

  
  <InfoPlistPermission Include="LSApplicationQueriesSchemes" Type="stringarray" Value="fb;instagram;twitter" />

  
  <InfoPlistPermission Include="UIDeviceFamily" Type="integerarray" Value="1;2" />
</ItemGroup>

This generates $(IntermediateOutputPath)Info.plist:

<plist version="1.0">
    <dict>
        <key>NSCameraUsageDescription</key>
        <string>We need camera access for video calls</string>
        <key>NSLocationWhenInUseUsageDescription</key>
        <string>Your location helps us find nearby places</string>
        <key>UIRequiresPersistentWiFi</key>
        <true/>
        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>fb</string>
            <string>instagram</string>
            <string>twitter</string>
        </array>
        <key>UIDeviceFamily</key>
        <array>
            <integer>1</integer>
            <integer>2</integer>
        </array>
    </dict>
</plist>

Metadata

Metadata Required Default Description
Type No string Value type: string, boolean / bool, stringarray, or integerarray
Value No empty The entry value. For arrays, separate items with ;

Samples

See the samples/SampleMauiApp project for a .NET MAUI app demonstrating MauiPermission with Camera, BluetoothLE, Location, Push, Biometric, and Contacts.

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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-beta-0009 34 3/25/2026
1.0.0-beta-0008 44 3/17/2026
1.0.0-beta-0007 37 3/17/2026