我正在尝试将授权标头添加到 SwaggerUI api 测试中。下面是我的 Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.Configure<ApiBehaviorOptions>(options =>
{
options.SuppressModelStateInvalidFilter = true;
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo
{
Version = "v1",
Title = "API",
Description = "QPIN API with ASP.NET Core 3.0",
Contact = new OpenApiContact()
{
Name = "Tafsir Dadeh Zarrin",
Url = new Uri("http://www.tdz.co.ir")
}
});
var securitySchema = new OpenApiSecurityScheme
{
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
Name = "Authorization",
In = …Run Code Online (Sandbox Code Playgroud) swagger swagger-ui asp.net-core asp.net-core-webapi .net-core-3.0
我正在使用 WF 4 处理重新托管的工作流设计器,我使用此设计器控件的应用程序是一个多语言应用程序,它加载 2 个或更多语言特定的资源 dll。如果我有一种语言(例如“en”和“en-US”)的两个附属程序集,则设计器会抛出如下异常:
Compiler error(s) encountered processing expression "testExpression". The project already has a reference to assembly MyProject.resources. A second reference to 'C:\Dlls\en-US\MyProject.resources.dll' cannot be added.
Run Code Online (Sandbox Code Playgroud)
这是堆栈跟踪:
at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](LocationReferenceEnvironment environment, Boolean isLocationReference)
at Microsoft.VisualBasic.Activities.VisualBasicHelper.Compile[T](LocationReferenceEnvironment environment)
Run Code Online (Sandbox Code Playgroud)
值得一提的是,当我查看附属程序集的属性、详细信息选项卡时,我意识到它们都是中性语言。我认为它们必须是特定语言,以便应用程序可以识别这些 dll 不相同。
我能做些什么来克服这个问题,我可以将 dll 文件的语言属性更改为语言特定吗?这有帮助吗?