Home >Common Problem >Windows.Storage namespace not found error on Windows PC [Fixed]

Windows.Storage namespace not found error on Windows PC [Fixed]

WBOY
WBOYforward
2023-04-16 13:40:051720browse

Visual Studio users, mainly those working on portable library class projects have come up with this "Windows". Storage namespace not found" error prompts, they are received in studio. This issue seems to be due to the missing of a specific dll file on the system. In some cases, the same may appear if the variable is declared wrong problem. So without wasting time, jump into the main solution and solve the problem yourself.

Fix 1 – Add the Windows Runtime DLL to the project

You have to add the Reference to the Runtime.WindowsRuntime.dll file and test it.

1. Open the project in Visual Studio if it is not already open.

2. Then, click "View" on the menu bar and click "Solution Explorer" to open Solution Explorer in VS.

Windows.Storage namespace not found error on Windows PC [Fixed]

3. On the Solution Explorer page, right-click the References tab and click Add Reference... to access the tab.

Windows.Storage namespace not found error on Windows PC [Fixed]

4. Now, in the Citation Manager window, go to the Browse tab.

5. Then, Click "Browse..." to browse to the DLL file.

Windows.Storage namespace not found error on Windows PC [Fixed]

6. Next go to this location –

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1

7 . Find the DLL file. Select "All files" from the drop-down list.

8. Select the "System.Runtime.WindowsRuntime.dll" dll file.

9. Then, click "Add" to add the dll file to your project.

Windows.Storage namespace not found error on Windows PC [Fixed]

After adding the DLL file, try to Test the build on your computer. The problem will not reoccur.

Fix 2 – Declare the variable globally

This is another common mistake that programmers often make. You must make the variable Windows. Storage.ApplicationData is declared as a global variable on the machine.

So, just include it in your code –

global::Windows.Storage.ApplicationData

Then, run all tests using build. If error still exists, you can use the Global Object Browser after the next fix.

Fix 3 – Using the Object Browser

There is another tool available for identifying the Object Browser.

1. Load the build in Visual Studio.

2. Then, click "View" from the menu tab and select "ObjectBrowser" to open it.

You can also use the Ctrl Alt J keys at the same time.

Windows.Storage namespace not found error on Windows PC [Fixed]

3. Now, set "Browse" to "All Components" from the drop-down list.

Windows.Storage namespace not found error on Windows PC [Fixed]

will load an extensive list of components.

4. Select "System.Runtime.WindowsRuntime.dll" carefully.

4. Next, click the "Add Reference to Selected Item" icon in the Object Browser to add it to your code.

Windows.Storage namespace not found error on Windows PC [Fixed]

This way you can easily add reference objects to your project library.

The above is the detailed content of Windows.Storage namespace not found error on Windows PC [Fixed]. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yundongfang.com. If there is any infringement, please contact admin@php.cn delete