locked
How to resolve " 'IAsyncActionWithProgress<>' is defined in an assembly that is not referenced" in Windows UAP app in Visual Studio Ultimate CTP 2015 .

    Question

  • Hi,

    I am developing a Windows UAP app in Visual Studio Ultimate  CTP 2015 (latest one available in site). 

    I am facing issues while using await on Functions returning IAsyncActionWithProgress<>, IAsyncAction<> , IAsyncOperation<> and IAsyncOperationWithProgress<>. 

    I am getting the following error 

    Error CS0012 The type 'IAsyncActionWithProgress<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.

    I tried adding reference to the assembly mentioned (Windows). Even though this resolved the above error, it created another error at many other places (seems like there is a repetition of some classes/API's in both the assemblies. One of the error obtained is :

    Error CS0433 The type 'Page' exists in both 'Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' and 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.

    Example of code 

    Windows.Storage.FileProperties.BasicProperties fileSize = await file.GetBasicPropertiesAsync();

    This was working fine for a Windows Phone 8.1 app in Visual Studio 2013. 

    What is the change I have to make to get the same result in UAP App in Visual Studio 2015.

    Thanks.


    Thursday, April 16, 2015 10:13 AM

All replies

  • Hi Jose,

    I’ve tried to reproduce the issue and I haven’t been able to reproduce it. I’ve tried this code in a blank project and works perfect:

    var folder = ApplicationData.Current.LocalFolder;
    var a = await folder.GetBasicPropertiesAsync();

    Could you give me more information about how to reproduce the problem?

    Thank you very much,

    Adrian


    Adrián Fernández

    Thursday, April 16, 2015 11:51 AM