joym8
joym8

Reputation: 4232

Windows.Storage namespace not visible in portable class library project

I'm trying to create a portable class library targeting .NET 4.5, Windows 8 and Windows 8.1

I'm unable to use the StorageFolder class which resides in the Windows.Storage namespace (http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.aspx).

The only reference in the project's References branch is named .NET and object browsing it shows it does have StorageFolder class located under Windows, under Windows.Storage namespace. But when I try to add a reference, I just see a small list of available assemblies which does not have anything with Windows in it.

I'm using VS2013 with update 3 on a Windows 8.1 x64.

Upvotes: 3

Views: 8043

Answers (1)

Chubosaurus Software
Chubosaurus Software

Reputation: 8161

I think you're using the object browser incorrectly. By default it will show All Components

enter image description here

To get to what you actually have, you need to select ".NET Portable Subset (Visual Studio 2013)"

If you really want to add the Windows.Storage then you have to select

"All Components" and search for Windows.winmd

Highlight that Component then click on the "Add to References in Selected Project in Solution Explorer" Button. Located here:

enter image description here

That will add that reference over to the Portable Library project (which imho, defeats the purpose)

Then in your Class1.cs you can you use your StorageFolder


enter image description here

Upvotes: 4

Related Questions