我们在 azure web api 站点中部署了一些 web 作业。我们认为其中之一存在内存泄漏,但我们没有详细说明是什么原因造成的。因此,我想看看是否可以将 nuget 包添加到应用程序洞察中。https://github.com/Azure/azure-webjobs-sdk/wiki/Application-Insights-Integration
当我尝试运行它时,我收到如下错误
class Program
{
private static string ConnectionString { get; set; }
private static readonly JobHostConfiguration _config = new JobHostConfiguration("DefaultEndpointsProtocol=https;AccountName=mcastagstorage;AccountKey=fW/DoBsghvPgEy2/uBTZSxSSvgPoUs/jGRxV59scXmexpfDSPbSGLovjAuoLtGbSIuDBobDHyIfUdHrWWRz5DA==;EndpointSuffix=core.windows.net");
// Please set the following connection strings in app.config for this WebJob to run:
// AzureWebJobsDashboard and AzureWebJobsStorage
static void Main()
{
string instrumentationKey = "MyKey";
if (!string.IsNullOrEmpty(instrumentationKey))
{
// Wire up with default filters; Filtering will be explained later.
_config.LoggerFactory = new LoggerFactory()
.AddApplicationInsights(instrumentationKey, null)
.AddConsole();
_config.Tracing.ConsoleLevel = TraceLevel.Off;
}
ConnectionString = ConfigurationManager.ConnectionStrings["ConsistingEntities"].ConnectionString;
if (_config.IsDevelopment)
{
_config.UseDevelopmentSettings();
}
var host = new JobHost(_config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
}
LoaderExceptions 如下
我对 .net 版本也很困惑,我习惯了原始的 .net,但现在看到 .net 标准和核心,不确定我应该使用什么 .net。
任何帮助将不胜感激