我有一个扩展,正在从 VS2019 更新到 VS2022。它是使用建模 SDK 的 DSL,并通过 T4 模板生成代码。
我已经把它转换得差不多了,但是当运行 T4 时,我得到了
Compiling transformation: The type 'SourceControl' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'Project' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'Constants' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'ProjectItem' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, …Run Code Online (Sandbox Code Playgroud) 我们正在尝试在 ASP.NET Core WebApi 应用程序 (.NET 5) 中首次使用 Hangfire (v1.7.19)。以前它们都是老式的 ASP.NET,并且运行没有问题。
使用的 Hangfire 软件包(根据Hangfire 文档)是Hangfire.Core、Hangfire.SqlServer和Hangfire.AspNetCore。我们也尝试过仅使用组合Hangfire包,但得到了相同的结果。
直接从该文档页面上的代码中提取,在ConfigureServices中我们添加
services.AddHangfire(configuration => configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSqlServerStorage(connectionString), new SqlServerStorageOptions
{
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.Zero,
UseRecommendedIsolationLevel = true,
DisableGlobalLocks = true
}));
Run Code Online (Sandbox Code Playgroud)
在运行时,给出
System.ArgumentException
HResult=0x80070057
Message=Keyword not supported: 'authentication'.
Source=System.Data.SqlClient
StackTrace:
at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String …Run Code Online (Sandbox Code Playgroud) azure-active-directory hangfire azure-sql-database asp.net-core-webapi hangfire-sql