Я создал новую функцию C # непосредственно из портала (версия ~ 1, шаблон триггера http) и добавил зависимость nuget, как показано ниже:
{
"frameworks": {
"net46":{
"dependencies": {
"Google.Apis" : "1.34.0"
}
}
}
}
Это связанный файл project.json.lock:
{
"version": 2,
"targets": {
".NETFramework,Version=v4.6": {
"Google.Apis/1.34.0": {
"type": "package",
"dependencies": {
"Google.Apis.Core": "1.34.0",
"Newtonsoft.Json": "10.0.2",
"System.Net.Http": "4.3.1"
},
"compile": {
"lib/net45/Google.Apis.PlatformServices.dll": {},
"lib/net45/Google.Apis.dll": {}
},
"runtime": {
"lib/net45/Google.Apis.PlatformServices.dll": {},
"lib/net45/Google.Apis.dll": {}
}
},
"Google.Apis.Core/1.34.0": {
"type": "package",
"dependencies": {
"Newtonsoft.Json": "10.0.2",
"System.Net.Http": "4.3.1"
},
"compile": {
"lib/net45/Google.Apis.Core.dll": {}
},
"runtime": {
"lib/net45/Google.Apis.Core.dll": {}
}
},
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
},
"runtime": {
"lib/net45/Newtonsoft.Json.dll": {}
}
},
"System.Net.Http/4.3.1": {
"type": "package",
"dependencies": {
"System.Security.Cryptography.X509Certificates": "4.3.0"
},
"frameworkAssemblies": [
"System",
"System.Core",
"mscorlib"
],
"compile": {
"ref/net46/System.Net.Http.dll": {}
},
"runtime": {
"lib/net46/System.Net.Http.dll": {}
},
"runtimeTargets": {
"runtimes/win/lib/net46/System.Net.Http.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Security.Cryptography.Algorithms/4.3.0": {
"type": "package",
"dependencies": {
"System.Security.Cryptography.Primitives": "4.3.0"
},
"frameworkAssemblies": [
"System.Core",
"mscorlib"
],
"compile": {
"ref/net46/System.Security.Cryptography.Algorithms.dll": {}
},
"runtime": {
"lib/net46/System.Security.Cryptography.Algorithms.dll": {}
},
"runtimeTargets": {
"runtimes/win/lib/net46/System.Security.Cryptography.Algorithms.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Security.Cryptography.Encoding/4.3.0": {
"type": "package",
"frameworkAssemblies": [
"System",
"mscorlib"
],
"compile": {
"ref/net46/System.Security.Cryptography.Encoding.dll": {}
},
"runtime": {
"lib/net46/System.Security.Cryptography.Encoding.dll": {}
},
"runtimeTargets": {
"runtimes/unix/lib/netstandard1.3/System.Security.Cryptography.Encoding.dll": {
"assetType": "runtime",
"rid": "unix"
},
"runtimes/win/lib/net46/System.Security.Cryptography.Encoding.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Security.Cryptography.Primitives/4.3.0": {
"type": "package",
"frameworkAssemblies": [
"mscorlib"
],
"compile": {
"ref/net46/System.Security.Cryptography.Primitives.dll": {}
},
"runtime": {
"lib/net46/System.Security.Cryptography.Primitives.dll": {}
}
},
"System.Security.Cryptography.X509Certificates/4.3.0": {
"type": "package",
"dependencies": {
"System.Security.Cryptography.Algorithms": "4.3.0",
"System.Security.Cryptography.Encoding": "4.3.0"
},
"frameworkAssemblies": [
"System",
"System.Core",
"mscorlib"
],
"compile": {
"ref/net46/System.Security.Cryptography.X509Certificates.dll": {}
},
"runtime": {
"lib/net46/System.Security.Cryptography.X509Certificates.dll": {}
},
"runtimeTargets": {
"runtimes/win/lib/net46/System.Security.Cryptography.X509Certificates.dll": {
"assetType": "runtime",
"rid": "win"
}
}
}
}
},
"libraries": {
"Google.Apis/1.34.0": {
"sha512": "V8Ng2gtvdgTeQvF5TtrFeFsg/YnQoas/I/b0Vg/NhKjpSo/v+i+71j7Al5kYZAADGYi0yVVWuBgHjHa4sE0o8g==",
"type": "package",
"path": "google.apis/1.34.0",
"files": [
"google.apis.1.34.0.nupkg.sha512",
"google.apis.nuspec",
"lib/net45/Google.Apis.PlatformServices.dll",
"lib/net45/Google.Apis.dll",
"lib/net45/Google.Apis.pdb",
"lib/net45/Google.Apis.xml",
"lib/netstandard1.3/Google.Apis.dll",
"lib/netstandard1.3/Google.Apis.pdb",
"lib/netstandard1.3/Google.Apis.xml"
]
},
"Google.Apis.Core/1.34.0": {
"sha512": "a8KvNrdkRKqyVSsUtxc0LcuVN78bsaRNyw4eCA1BBpRVIShsZODrNV8Lv/E/T2h4rRGdgRXB2wJ7ZSs1CLCjdw==",
"type": "package",
"path": "google.apis.core/1.34.0",
"files": [
"google.apis.core.1.34.0.nupkg.sha512",
"google.apis.core.nuspec",
"lib/net45/Google.Apis.Core.dll",
"lib/net45/Google.Apis.Core.pdb",
"lib/net45/Google.Apis.Core.xml",
"lib/netstandard1.3/Google.Apis.Core.dll",
"lib/netstandard1.3/Google.Apis.Core.pdb",
"lib/netstandard1.3/Google.Apis.Core.xml"
]
},
"Newtonsoft.Json/10.0.2": {
"sha512": "iwElSU2IXmwGvytJsezyDML2ZWDkG2JzTYzlU/BNlmzMdlmRvbnwITsGGY74gwVEpDli1UdOLkMT7/3jxWvXzA==",
"type": "package",
"path": "newtonsoft.json/10.0.2",
"files": [
"LICENSE.md",
"lib/net20/Newtonsoft.Json.dll",
"lib/net20/Newtonsoft.Json.xml",
"lib/net35/Newtonsoft.Json.dll",
"lib/net35/Newtonsoft.Json.xml",
"lib/net40/Newtonsoft.Json.dll",
"lib/net40/Newtonsoft.Json.xml",
"lib/net45/Newtonsoft.Json.dll",
"lib/net45/Newtonsoft.Json.xml",
"lib/netstandard1.0/Newtonsoft.Json.dll",
"lib/netstandard1.0/Newtonsoft.Json.xml",
"lib/netstandard1.3/Newtonsoft.Json.dll",
"lib/netstandard1.3/Newtonsoft.Json.xml",
"lib/portable-net40+sl5+win8+wpa81+wp8/Newtonsoft.Json.dll",
"lib/portable-net40+sl5+win8+wpa81+wp8/Newtonsoft.Json.xml",
"lib/portable-net45+win8+wpa81+wp8/Newtonsoft.Json.dll",
"lib/portable-net45+win8+wpa81+wp8/Newtonsoft.Json.xml",
"newtonsoft.json.10.0.2.nupkg.sha512",
"newtonsoft.json.nuspec",
"tools/install.ps1"
]
},
"System.Net.Http/4.3.1": {
"sha512": "UrTyRczM3ZvNk6oetBuwlu67MFKKRva+r7bw4JDVZ6Y2IukyZ24td5ppsieu/4yZlogVAIuZul9GIQ3hoiz0yA==",
"type": "package",
"path": "system.net.http/4.3.1",
"files": [
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/Xamarinmac20/_._",
"lib/monoandroid10/_._",
"lib/monotouch10/_._",
"lib/net45/_._",
"lib/net46/System.Net.Http.dll",
"lib/portable-net45+win8+wpa81/_._",
"lib/win8/_._",
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"ref/Xamarinmac20/_._",
"ref/monoandroid10/_._",
"ref/monotouch10/_._",
"ref/net45/_._",
"ref/net46/System.Net.Http.dll",
"ref/net46/System.Net.Http.xml",
"ref/net46/de/System.Net.Http.xml",
"ref/net46/es/System.Net.Http.xml",
"ref/net46/fr/System.Net.Http.xml",
"ref/net46/it/System.Net.Http.xml",
"ref/net46/ja/System.Net.Http.xml",
"ref/net46/ko/System.Net.Http.xml",
"ref/net46/ru/System.Net.Http.xml",
"ref/net46/zh-hans/System.Net.Http.xml",
"ref/net46/zh-hant/System.Net.Http.xml",
"ref/netcore50/System.Net.Http.dll",
"ref/netcore50/System.Net.Http.xml",
"ref/netcore50/de/System.Net.Http.xml",
"ref/netcore50/es/System.Net.Http.xml",
"ref/netcore50/fr/System.Net.Http.xml",
"ref/netcore50/it/System.Net.Http.xml",
"ref/netcore50/ja/System.Net.Http.xml",
"ref/netcore50/ko/System.Net.Http.xml",
"ref/netcore50/ru/System.Net.Http.xml",
"ref/netcore50/zh-hans/System.Net.Http.xml",
"ref/netcore50/zh-hant/System.Net.Http.xml",
"ref/netstandard1.1/System.Net.Http.dll",
"ref/netstandard1.1/System.Net.Http.xml",
"ref/netstandard1.1/de/System.Net.Http.xml",
"ref/netstandard1.1/es/System.Net.Http.xml",
"ref/netstandard1.1/fr/System.Net.Http.xml",
"ref/netstandard1.1/it/System.Net.Http.xml",
"ref/netstandard1.1/ja/System.Net.Http.xml",
"ref/netstandard1.1/ko/System.Net.Http.xml",
"ref/netstandard1.1/ru/System.Net.Http.xml",
"ref/netstandard1.1/zh-hans/System.Net.Http.xml",
"ref/netstandard1.1/zh-hant/System.Net.Http.xml",
"ref/netstandard1.3/System.Net.Http.dll",
"ref/netstandard1.3/System.Net.Http.xml",
"ref/netstandard1.3/de/System.Net.Http.xml",
"ref/netstandard1.3/es/System.Net.Http.xml",
"ref/netstandard1.3/fr/System.Net.Http.xml",
"ref/netstandard1.3/it/System.Net.Http.xml",
"ref/netstandard1.3/ja/System.Net.Http.xml",
"ref/netstandard1.3/ko/System.Net.Http.xml",
"ref/netstandard1.3/ru/System.Net.Http.xml",
"ref/netstandard1.3/zh-hans/System.Net.Http.xml",
"ref/netstandard1.3/zh-hant/System.Net.Http.xml",
"ref/portable-net45+win8+wpa81/_._",
"ref/win8/_._",
"ref/wpa81/_._",
"ref/xamarinios10/_._",
"ref/xamarintvos10/_._",
"ref/xamarinwatchos10/_._",
"runtimes/unix/lib/netstandard1.6/System.Net.Http.dll",
"runtimes/win/lib/net46/System.Net.Http.dll",
"runtimes/win/lib/netcore50/System.Net.Http.dll",
"runtimes/win/lib/netstandard1.3/System.Net.Http.dll",
"system.net.http.4.3.1.nupkg.sha512",
"system.net.http.nuspec"
]
},
"System.Security.Cryptography.Algorithms/4.3.0": {
"sha512": "W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==",
"type": "package",
"path": "system.security.cryptography.algorithms/4.3.0",
"files": [
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Security.Cryptography.Algorithms.dll",
"lib/net461/System.Security.Cryptography.Algorithms.dll",
"lib/net463/System.Security.Cryptography.Algorithms.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/System.Security.Cryptography.Algorithms.dll",
"ref/net461/System.Security.Cryptography.Algorithms.dll",
"ref/net463/System.Security.Cryptography.Algorithms.dll",
"ref/netstandard1.3/System.Security.Cryptography.Algorithms.dll",
"ref/netstandard1.4/System.Security.Cryptography.Algorithms.dll",
"ref/netstandard1.6/System.Security.Cryptography.Algorithms.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"ref/xamarintvos10/_._",
"ref/xamarinwatchos10/_._",
"runtimes/osx/lib/netstandard1.6/System.Security.Cryptography.Algorithms.dll",
"runtimes/unix/lib/netstandard1.6/System.Security.Cryptography.Algorithms.dll",
"runtimes/win/lib/net46/System.Security.Cryptography.Algorithms.dll",
"runtimes/win/lib/net461/System.Security.Cryptography.Algorithms.dll",
"runtimes/win/lib/net463/System.Security.Cryptography.Algorithms.dll",
"runtimes/win/lib/netcore50/System.Security.Cryptography.Algorithms.dll",
"runtimes/win/lib/netstandard1.6/System.Security.Cryptography.Algorithms.dll",
"system.security.cryptography.algorithms.4.3.0.nupkg.sha512",
"system.security.cryptography.algorithms.nuspec"
]
},
"System.Security.Cryptography.Encoding/4.3.0": {
"sha512": "1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==",
"type": "package",
"path": "system.security.cryptography.encoding/4.3.0",
"files": [
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Security.Cryptography.Encoding.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/System.Security.Cryptography.Encoding.dll",
"ref/netstandard1.3/System.Security.Cryptography.Encoding.dll",
"ref/netstandard1.3/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/de/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/es/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/fr/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/it/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/ja/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/ko/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/ru/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/zh-hans/System.Security.Cryptography.Encoding.xml",
"ref/netstandard1.3/zh-hant/System.Security.Cryptography.Encoding.xml",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"ref/xamarintvos10/_._",
"ref/xamarinwatchos10/_._",
"runtimes/unix/lib/netstandard1.3/System.Security.Cryptography.Encoding.dll",
"runtimes/win/lib/net46/System.Security.Cryptography.Encoding.dll",
"runtimes/win/lib/netstandard1.3/System.Security.Cryptography.Encoding.dll",
"system.security.cryptography.encoding.4.3.0.nupkg.sha512",
"system.security.cryptography.encoding.nuspec"
]
},
"System.Security.Cryptography.Primitives/4.3.0": {
"sha512": "7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==",
"type": "package",
"path": "system.security.cryptography.primitives/4.3.0",
"files": [
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Security.Cryptography.Primitives.dll",
"lib/netstandard1.3/System.Security.Cryptography.Primitives.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/System.Security.Cryptography.Primitives.dll",
"ref/netstandard1.3/System.Security.Cryptography.Primitives.dll",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"ref/xamarintvos10/_._",
"ref/xamarinwatchos10/_._",
"system.security.cryptography.primitives.4.3.0.nupkg.sha512",
"system.security.cryptography.primitives.nuspec"
]
},
"System.Security.Cryptography.X509Certificates/4.3.0": {
"sha512": "t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==",
"type": "package",
"path": "system.security.cryptography.x509certificates/4.3.0",
"files": [
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net46/System.Security.Cryptography.X509Certificates.dll",
"lib/net461/System.Security.Cryptography.X509Certificates.dll",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/net46/System.Security.Cryptography.X509Certificates.dll",
"ref/net461/System.Security.Cryptography.X509Certificates.dll",
"ref/netstandard1.3/System.Security.Cryptography.X509Certificates.dll",
"ref/netstandard1.3/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/de/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/es/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/fr/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/it/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/ja/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/ko/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/ru/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/zh-hans/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.3/zh-hant/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/System.Security.Cryptography.X509Certificates.dll",
"ref/netstandard1.4/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/de/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/es/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/fr/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/it/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/ja/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/ko/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/ru/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/zh-hans/System.Security.Cryptography.X509Certificates.xml",
"ref/netstandard1.4/zh-hant/System.Security.Cryptography.X509Certificates.xml",
"ref/xamarinios10/_._",
"ref/xamarinmac20/_._",
"ref/xamarintvos10/_._",
"ref/xamarinwatchos10/_._",
"runtimes/unix/lib/netstandard1.6/System.Security.Cryptography.X509Certificates.dll",
"runtimes/win/lib/net46/System.Security.Cryptography.X509Certificates.dll",
"runtimes/win/lib/net461/System.Security.Cryptography.X509Certificates.dll",
"runtimes/win/lib/netcore50/System.Security.Cryptography.X509Certificates.dll",
"runtimes/win/lib/netstandard1.6/System.Security.Cryptography.X509Certificates.dll",
"system.security.cryptography.x509certificates.4.3.0.nupkg.sha512",
"system.security.cryptography.x509certificates.nuspec"
]
}
},
"projectFileDependencyGroups": {
"": [],
".NETFramework,Version=v4.6": [
"Google.Apis >= 1.34.0"
]
},
"tools": {},
"projectFileToolGroups": {},
"packageFolders": {
"D:\\home\\data\\Functions\\packages\\nuget": {}
}
}
Теперь при запуске функции по заданному шаблону она получает ошибку компиляции:
2018-06-08T17: 29: 55.711 [Ошибка] Ошибка компиляции функции2018-06-08T17: 29: 55.711 [Ошибка] run.csx (8,19): ошибка CS1929: «HttpRequestMessage» не содержит определения для «GetQueryNameValuePairs» и лучшая перегрузка метода расширения «HttpRequestMessageExtensions.GetQueryNameValuePairsMairsPairs (H)требуется приемник типа «HttpRequestMessage» 2018-06-08T17: 29: 55.711 [Ошибка] run.csx (15,30): ошибка CS1929: «HttpContent» не содержит определения для «ReadAsAsync» и лучшая перегрузка метода расширенияДля 'HttpContentExtensions.ReadAsAsync (HttpContent)' требуется получатель типа 'HttpContent' 2018-06-08T17: 29: 55.711 [Ошибка] run.csx (20,11): ошибка CS1929: 'HttpRequestMessage 'не содержит определения для' CreateResponse 'и наилучшей перегрузки метода расширения' HttpRequestMessageExtensions.CreateResponse (HttpRequestMessage, HttpStatusCode, string) 'требует приемник типа' HttpRequestMessage '2018-06-08T11: ошибка 298-06-08: 17: ошибка:.csx (21,11): ошибка CS1929: «HttpRequestMessage» не содержит определения для «CreateResponse» и лучшая перегрузка метода расширения «HttpRequestMessageExtensions.CreateResponse (HttpRequestMessage, HttpStatusCode, string)» требует получения типа «H8» Ht-06-08T17: 29: 55.742 [Ошибка] Исключительная ситуация при выполнении функции: Functions.ganalytics.Microsoft.Azure.WebJobs.Script: Ошибка компиляции скрипта.2018-06-08T17: 29: 55.742 [Ошибка] Функция выполнена (Ошибка, Id = bfbba2a8-6946-4935-8495-f21973d408cb, Длительность = 44 мс)
Я понимаю, что это связано с проблемойс версией зависимости System.Net.Http, каким-то образом переопределенной из пакета Google.Api.( ссылка ) Я спрашиваю: есть ли обходной путь для устранения этой ошибки?
Заранее спасибо.