Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All in a sudden Functions compilation in Visual Studio fails with exception #586

Closed
ChristianWeyer opened this issue Nov 12, 2017 · 3 comments

Comments

@ChristianWeyer
Copy link

ChristianWeyer commented Nov 12, 2017

Hi all,

Did anybody ever see this?

I have a .NET 4.6.1 project. Everything worked fine - util a certain point.
From one moment to the other I get this exception:

2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): warning :
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : File name: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at System.Reflection.RuntimeMethodInfo.GetParameters()
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at MakeFunctionJson.MethodInfoExtensions.GetDisabled(MethodInfo method)
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at MakeFunctionJson.MethodInfoExtensions.HasUnsuportedAttributes(MethodInfo method, String& error)
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :    at MakeFunctionJson.FunctionJsonConverter.TryRun()
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : 
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : WRN: Assembly binding logging is turned OFF.
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Note: There is some performance penalty associated with assembly bind failure logging.
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : 
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Error generating functions metadata
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :
2>C:\Users\Christian Weyer\.nuget\packages\microsoft.net.sdk.functions\1.0.6\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Metadata generation failed.
2>Done building project "HomeAutomation-Functions.csproj" -- FAILED.

I restarted VS, no help.
Any idea?

Thanks!

@tohling
Copy link

tohling commented Nov 13, 2017

Could you add an explicit reference for Newtonsoft version 9.0.1 and see if the error goes away?

@ChristianWeyer
Copy link
Author

Thanks for this idea. Yep, tried that. Same result.

After further investigating, I found my issue is similar to this one:
Azure/azure-functions-vs-build-sdk#115
dotnet/sdk#1405

@ahmelsayed
Copy link

This issue was moved to Azure/azure-functions-vs-build-sdk#139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants