Windows IoT

Write and read to text file on usb drive in windows iot

Hello i have a raspberry pi 3 with windows iot core on it, Now i'm making an app with visual studio 2017.
My question is that i want to read and write to a textfile on an usb drive that is connected to my PI.
I looked around this site and find some same question but all of them don't work for me.
This is wat i have!!
The mainpage
Imports Windows.Storage
Imports Windows.Devices.Usb
Imports Windows.Devices.Enumeration
Public NotInheritable Class MainPage
Inherits Page
Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
End Sub
Private Async Sub OpenDeviceAsync()
Dim externalDevices As StorageFolder = KnownFolders.RemovableDevices
Dim externalDrives As IReadOnlyList(Of StorageFolder) = Await externalDevices.GetFoldersAsync()
Dim sdCard As StorageFolder = externalDrives(0)
If sdCard IsNot Nothing Then
Dim storageFolder As StorageFolder = KnownFolders.RemovableDevices
Dim sampleFile As StorageFile = Await sdCard.CreateFileAsync("sample.txt", CreationCollisionOption.ReplaceExisting)
End If
End Sub
End Class
the package.appxmanifest file i addes the usb capability
<Capability Name="internetClient" />
<uap:Capability Name="removableStorage" />
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
and the .txt extension
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="text">
then when i want to start the app thru remote machine on my pi 3, visual studio stops and give's the following page "App.g.i.vb" with text in yellow
AddHandler Me.UnhandledException,
Sub(sender As Global.System.Object, unhandledExceptionArgs As
If Global.System.Diagnostics.Debugger.IsAttached Then
Global.System.Diagnostics.Debugger.Break() <----- yellow
End If
End Sub
#End If
Can maby someone help me please. In the future i want also read .jpg files from the usb storage
Hi A.Pols,
Further to the response by Andre, if you search the forum you will find the existing answer to this issue at
My question is that i want to read and write to a textfile on an usb drive that is connected to my PI.
to access USB drive UWP apps need to work with RemovableDevices from
KnownFolders and you need to specify the Removable Storage capability
additionally you need to add every extension of the file types you want to access
you will find more information at ,
Files, folders, and libraries and
Universal Windows Platform (UWP) app samples
Hi A.Pols,
Further to the response by Andre, if you search the forum you will find the existing answer to this issue at

Related Links

BTLE Development
How to display a clock on multiple pages in Windows core IOT app
Windows IoT Scheduled Task not running
Custom IoT Image Crashes On Boot
Remote Desktop\Thin Client
Win 10 IoT Remote update multiple devices
Node.js Express 4 App not running on Raspberry pi 15063
windows iot remote display security
The accuracy of measuring a plus width by using GPIO event and stopwatch
Installing application on Windows IoT
RPi Serial Port Start Bit
Older Insider Preview ISOs
Formatting an SD card once windows 10 is installed on it
Infrared sensor needed für Win IoT
GPIOOneWire DHT22/AM2302
HD Photo Capture on Dragonboard


Visual Studio Languages
Windows Desktop Develo...
Commerce Server
JScript and Scripting
Internet Explorer Deve...
Microsoft Sync Framework
SQL Server
Bing Ads API: Development
Exchange Server
Skype for Business
Software Entwicklung f...
Announcements for all ...
Where is the Forum For…?
Forums Issues (not pro...
Visual C++
Visual Studio General ...
Visual Studio Tools fo...
Visual Studio Editor
Application Insights (AI)
Windows Desktop Develo...
Windows Desktop Winsoc...
Message Analyzer
Hardware Development B...
Excel for Developers
Word for Developers
SharePoint 2013 - Deve...
SharePoint 2010 - Gene...
SharePoint Legacy Vers...
Azure BizTalk Services
Azure Backup
Azure Marketplace
Azure Scheduler
Azure Mobile Engagement
Azure Logic Apps
Azure Service Fabric
Cognitive Services
Azure Stack
Azure Functions
Azure Analysis Services
Azure Log Integration
Claims based access pl...
Visual Studio Visualiz...
Team Foundation Server...
Team Foundation Server...
Architecture General
BizTalk Server RFID
The Forum of Sho
ISV Open Discussions
SyncFx - SyncToy-File ...
Windows Mobile Develop...
Visual Studio Smart De...
Data Mining
SQL Server Tools
SQL Server Distributed...
SQL Server Data Tools
Standard 2009: Compone...
Standard 2009: Tools
Standard 7: Misc
SQL Server 2012 High A...
Windows Live Writer: D...
Script Junkie Discussion
WebsitePanel - Develop...
Windows Protocols
SharePoint Server Prot...
Programming Silverligh...
MVVM / ViewModel Patte...
Windows Performance To...
Project Online General...
Architecture Events
Architecture, Tools, a...
Azure Startups
App Producer (archived)
CHESS – Find and Repro...
General Windows MultiP...
JScript for the .NET F...
Monitor, Alert and Aut...
Office Live Small Busi...
Parallel Computing Gen...
Oracle on Azure
Search Server: Develop...
Search Server: Federation
Search Server: Known B...
Server Core Developers
Surface Application De...
SQL Azure Labs Support
SQL Server 2014 High A...
SQL Server 2014 Self-S...
SQL Server 2014 Analys...
SQL Server 2014 Master...
SQL Server 2014 Integr...
Visual C# Express Edition
Visual C# IDE
Visual C++ 2008 (Pre-r...
Visual J# General (Ret...
Visual Studio 2008 SP1...
Visual Studio Source C...
Windows Phone Preview ...


Encrypt Message