Question

I have portable library (mvvmcross) solution and in Core project I have Live SDK method:

Client.DownloadCompleted += delegate(object o, LiveDownloadCompletedEventArgs e)
        {...}

Client.DownloadAsync(SKYDRIVE_PATH + USER_DEFINED_FILE);

There is problem with LiveDownloadCompletedEventArgs:

Error 1 The type 'System.ComponentModel.AsyncCompletedEventArgs' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

Where I find this System assembly? I tried to add this:

"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" 

but it is impossible to add system assembly.

Was it helpful?

Solution

Sadly if an API/library isn't available portably, then you won't be able to force it to be available by adding references to different System.dll assemblies.

Whenever APIs aren't available portably, I recommend either:

  • wrapping them behind interfaces and injecting them into the portable code from the native platforms. There are some examples of this in N=31 in http://mvvmcross.wordpress.com/
  • choose to put your code into non-portable libraries with code shared through file linking rather than through PCLs

Daniel Plaisted has more ideas on this at http://blogs.msdn.com/b/dsplaisted/archive/2012/08/27/how-to-make-portable-class-libraries-work-for-you.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top