So we have been loving everything about functions except the fact that we have to keep certain libraries behind as Azure Functions like the idea of certain libraries updating. Microsoft.Owin is one of them. We would love to be on version 4.
Could not load file or assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have tried everything such as forcing via Project.json as well as consolidating across the entire solution. Locally debugging in VS same error happens. So deployed as well as local this is happening.
We get the similar issues with other libraries such as AMQP.
We are running the latest SDK as well - Microsoft.NET.SDK.Functions version 1.0.13
Possible duplicate of the following question.
Azure Functions - Could not load file or assembly ''Microsoft.WindowsAzure.Storage'
Try to find whether Owin is native library of Azure functions or not. If yes, you can refer it directly. #r "Library.Namspace". Otherwise, you need to follow the suggestions in above thread.
Thanks Ashokan for your fast response. I think I may have found a solution to this problem.
https://blog.slaks.net/2013-12-25/redirecting-assembly-loads-at-runtime/ Rather in particular this post : https://blog.slaks.net/2013-12-25/redirecting-assembly-loads-at-runtime/
Look at "npiasecki commented on May 2, 2017" and he explains there. That pretty much did the trick and all is working now - locally, debugging via Visual Studio.