格式化我的电脑后,我重新安装了Vs 2017 V 15.6.3并从Microsoft 2.1.4安装ASP.Net Core SDK
但是当我创建新的asp核心应用程序VS失败时出错
"项目文件不完整.缺少预期的进口"
拜托,有人可以帮忙吗?
我正在开发在 github GitHub IdentityServer4.AdminUI上开发的 IdentityServer4.AdminUI
首先,我简单地创建了一个新用户并设置了它的密码,然后我创建了名为Api_Name 的新ApiResource。然后我创建了具有相同名称的 IdentityResource Api_Name。最后,我创建了名为Api_Client 的新客户端,并将客户端允许的范围设置为Api_Name,将允许的授予类型设置为密码,最后将客户端密码设置为秘密
现在,我创建了新的 WebApi 项目(Core 2.1)并在启动类中使用它
public void ConfigureServices(IServiceCollection services) {
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddMvcCore().AddAuthorization().AddJsonFormatters();
services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options => {
options.Authority = "http://localhost:5000"; //Identity Server URL
options.RequireHttpsMetadata = false; // make it false since we are not using https
options.ApiName = "Api_Name"; //api name which should be registered in IdentityServer
});
}
// This method gets called by the runtime. …Run Code Online (Sandbox Code Playgroud)