0

I'm working with compiling the google apps API and I haven't seen it where I'm missing.

Properties of project

.net and windows 8/8.1 are both listed but nothing else. I'm running VS 2013 on a Windows 7 computer.

Because of this, when I go into references to the project, I'm missing all of the original microsoft references (even if I go to add them, there's nothing to select from).

For example, the error I'm getting is: Warning 2 The primary reference "System.IO", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile5". To resolve this problem, either remove the reference "System.IO" or retarget your application to a framework version which contains "System.IO". Google.Apis.Admin.Directory.directory_v1

I'm not sure why that and all the other microsoft API's are not showing up when I go to select them (or not allowing me to compile). I assume it's because of the .netportable and the fact I'm not on a Windows 8.x computer.

Anyone know how to change the target? I don't see anyway of doing that.

Zonus
  • 2,313
  • 2
  • 26
  • 48

1 Answers1

1

What you have there is a Portable Class Library. It's lacking many namespaces and functions that are native to Windows only; basically, a PCL is reduced to the minimum feature set of .NET that can run on all target platforms.
For many missing namespaces there are replacement PCLs; if none is available, you can define interfaces in the PCL (and implement them in platform-specific code) that serve as a "bridge" between the PCL and e.g. the System.IO namespace on Win32.

Simple example: You define IFileIO with WriteFile(...) and ReadFile(...) in the PCL; then every project that uses the PCL (ex.: WindowsIO Windows) has a class that implements IFileIO and executes the System.IO calls within the respective functions.
Then you combine the Windows-specific implementation with the PCL interface; imagine you have a ImageConverter class that reads, modifies and writes images. Its constructor accepts an IFileIO, where you can pass a WindowsIO instance (or Win8IO, or AndroidIO, or ...). The ImageConverter only uses the interface and doesn't care about the implementation.

jan.h
  • 524
  • 5
  • 11
  • That's what i was thinking; thanks for the confirmation. Anyway I can change the target? I just need a temporary fix until they release a signed version of the API – Zonus Feb 24 '15 at 00:20
  • @DaBlue: You could try [converting it to a regular class library](http://stackoverflow.com/questions/20094075/convert-a-pcl-to-a-regular-class-library). I don't know what subset of .NET the Windows 8 target has, but I guess most namespaces should be covered. – jan.h Feb 24 '15 at 00:24