-
Notifications
You must be signed in to change notification settings - Fork 441
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
Azure Functions on .NET CORE (Application Insights and SQLClient Support) #2473
Comments
Also noticed that when my Azure Function tries to use System.Data.SqlClient it gives an error with: FileLoadException: Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' I can't even find this package on nuget? I have the latest installed 4.4.2, so I guess somewhere on the Azure Function .NET Core server it has this older version it is looking for? How do I resolve these missing assemblies for Azure Functions using .NET Core? |
@tsmccartan Azure/azure-webjobs-sdk#1472 (comment) look at this comment I had exactly the same problem and after downgrade to 4.4.0 it works |
@vovikdrg is right, i met this issue and only just 4.4.0 works, others isn't work except higher or lower, i don't know the reason, anybody can explain ? |
Thanks all, the downgrade to 4.4.0 solved the SqlClient Issues. Does anybody know how to get the Application Insights to work, so you can create your own Telemetry Metric? Error says it is trying to load 2.5.1, and that is what the nuget package contains, but still this error is thrown trying to create new telemetry using the code above. |
I have exactly the same problem with .NET Core when attempting to perform custom telemetry. |
Should be fixed with new release. Brett will verify. |
@mathewc EXCEPTION I have the following NuGet Packages Referenced:
|
I had the same issue with 2.5.1 package of Application Insights. Had to fall back to version 2.2.0 to get it running |
Upgrading to Microsoft.ApplicationInsights v2.6.0-beta2 doesn't resolve the issue:
Downgrading to v2.4.0 seems to work, also for my other dependent packages. <ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.4.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.4.0" />
<PackageReference Include="Serilog" Version="2.6.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="2.2.2" />
<PackageReference Include="Serilog.Sinks.AzureWebJobsTraceWriter-preview" Version="2.0.3-alpha" />
</ItemGroup> But Microsoft.ApplicationInsights v2.4.0 is not NetStandard and I am getting warnings:
|
Using Functions v2 runtime so .NET Core, attempted to use today's LTS version of App Insights (v2.6.1) and got the same "Could not load file or assembly" error. Reverted App Insights to v2.2 and everything loaded properly. Didn't try v2.4 though. @fabriciosanchez @codepossible can provide .csproj w/ all dependencies if necessary. |
I had to downgrade to System.Data.SqlClient Version 4.4.0 to get this working |
Any updates on this? It's been over a year -- where do things stand now? I need to get access to a |
You should be able to ask for a
This issue seems related to SQLClient support somehow? Is anyone still seeing that issue? |
Closing due to lack of response. |
What is the support for Application Insights with Azure Functions and .NET CORE? I have created an Azure Function for .NET Core, I did configure it to Application Insights and it is gathering telemetry. But when I try to create my own metrics using the below code, it always throws an error saying it could not load file or assembly.
Is the below supported, or is it just basic integration using log.info("Message...."); <-- This works
I have added all the nuget packages for ApplicationInsights 2.5.1
Code that causes the error:
var telemetryClient = new TelemetryClient();
telemetryClient.InstrumentationKey = Environment.GetEnvironmentVariable("APPINSIGHTS_INSTRUMENTATIONKEY");
Exception:
FileLoadException: Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)
The text was updated successfully, but these errors were encountered: