How to Fix Windows.Storage Namespace Not Found Error

Add references to UWP dlls and winmd manually to access APIs

by Madhuparna Roy
Madhuparna Roy
Madhuparna Roy
A diploma holder in computers and with a keen interest in technology, Madhuparna is passionate about writing How-to guides and helping people solve the most intricate Windows issues.... read more
Reviewed by Vlad Turiceanu
Vlad Turiceanu
Vlad Turiceanu
Editor-in-Chief
Passionate about technology, Windows, and everything that has a power button, he spent most of his time developing new skills and learning more about the tech world. Coming... read more
Affiliate Disclosure
  • While using Visual Studio for a portable class library project, many users may face an issue where the Windows.Storage namespace is not found. 
  • The issue seems to arise mostly due to an error on your end. For example, if you are not using the object browser correctly, or if you've not understood the error message. 
  • The trick lies in whether you are able to access the Windows APIs from WPF (Windows Presentation Foundation) and that's what the post focuses on. 
windows.storage namespace

XINSTALL BY CLICKING THE DOWNLOAD FILE
To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer's security and performance
  • Restoro has been downloaded by 0 readers this month.

When trying to build a UWP app you may sometimes realize that the Windows.Storage namespace is not found.

On a closer look, this issue arises mostly due to an error on your end, and that’s what we will discuss in further sections. But, if the UWP apps lag & stutter on your Windows 11 PC, you can refer to our post for some effective solutions.

What is Windows.Storage namespace?

Windows.Storage namespace is a collection of Windows APIs that offers classes for managing files, folders, and application settings.

The Microsoft official web page also explains how to use the objects in Windows.Storage namespace.

Why is Windows.Storage namespace not found?

Sometimes, while using Visual Studio you may encounter an issue like Windows.Storage namespace not available or not found. This could be due to any of the following reasons:

  • If you are using the object browser incorrectly The object browser is by default set to All Components which needs to be changed to what you have.
  • You have not included the reference to the proper package – You won’t get access to the Windows.Storage namespace, unless you add the references to the correct package.

Note that the System.Windows.Storage is not the same as Windows.Storage. If the error message reads System.Windows.Storage (part of .NET & the root namespace for WPF), it’s different from Windows.Storage (root namespace for WinRT, the primary API for UWP apps).

How can I fix Windows.Storage Namespace Not Found error?

1. Add the references to UWP DLLs and WINMD files manually

  1. When using Visual Studio, go to Solution Explorer, right-click on References, and select Add Reference from the context menu. add reference
  2. On the left side of the Reference Manager, click on Browse and navigate to the following path: C:Program Files (x86)Windows Kits10UnionMetadatawinmdbrowse to path
  3. Now, add it to your project as a reference. Also, make sure to change the filter to All Files.
  4. Again, right-click on References, and click on Add Reference from the context menu. add reference
  5. Next, on the left of the Reference Manager, go to Browse and find the directory, C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETCorev4.5.browse to path
  6. Add System.Runtime.WindowsRuntime.dll to your project.add System.Runtime.WindowsRuntime.dll

So, if you are unable to access Windows.Storage namespace, it could be possible that you have not added the reference to the proper package.

Note icon
NOTE
Here you can find the SDK.

In this situation, you may feel that Windows.Storage namespace is not found. You would need to download the package following the above steps.

You can now build your own WPF application location-aware by calling on the Geolocator class in Windows.Devices.Geolocation API.

At the same time, you can also use the asynchronous pattern in UWP. This is because the classes and methods you usually consider as UWP code is now incorporated with classes and methods from WPF.

But, if the Windows.storage.dll crashes on your Windows PC, we recommend a list of solutions that may help you fix the issue quickly.

2. Use the object browser correctly

  1. By default, the object browser is set to All Components, hence, firstly, select NET Portable Subset (Visual Studio 2013). all components
  2. Next, to add the Windows.Storage, select All Components, and look for Windows.winmd. search Windows.winmd
  3. Now, Highlight the desired Component, and click on Add to References in Selected Project under Solution Explorerreference added

This will add the reference to the Portable Library project, and you can now use your StorageFolder in Class1.cs.

Alternatively, if you do not want to install the Windows Store at this moment, but simply want to use some of those Windows APIs, you can get them from your app. How?

Nevertheless, you can achieve this by using a NuGet package, also called as UwpDesktop. To inspect the source code, you can visit GitHub.

If you have any other queries related to a missing Windows API, let us know in the comments section below.

Still having issues? Fix them with this tool:

SPONSORED

If the advices above haven't solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.

This article covers:Topics: