I've successfully referenced an assembly via Nuget and project.json that is a "Portable" assembly. All my code compiles in the Azure function, but when it's run I get:
Could not load file or assembly 'System.Net, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified.
As I understand it this is the portable version of System.Net, and Azure only preinstalls the 4.6 version of System.Net.
How do I work around this?
This is caused by a bug that has been addressed on the current Azure Functions host milestone and will be deployed with the next release (likely towards the end of the week). You can find more information about the issue and the fix here: https://github.com/Azure/azure-webjobs-sdk-script/issues/478
In the meantime, a workaround would be to copy System.Net from the Framework folder into a bin folder, inside of your function's folder. The host will automatically resolve it as a private assembly.