Azure WebAPIサイトにいくつかのWebジョブがデプロイされています。これらの1つにメモリリークがあると思われますが、原因の詳細はわかりません。したがって、アプリケーションインサイトに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を使用するのかわかりません。
どんな助けでも大歓迎です
私はあなたのコードをテストし、あなたの問題を再現しました。
WebJobsv3を使用しているようです。その場合、Newtonsoft.Jsonのバージョンは10.0.3になります。
この記事を読んだ後、これがwebjobのバグであることは示されませんでした。
私はそれを解決するために次の方法を使用します。よろしければ、WebJobs v2ベータに戻るか、Newtonsoft.Jsonをバージョン<10.0.3に更新してください。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加