在start up类里面添加这个方法
app.UseStaticFiles(new StaticFileOptions { RequestPath = "/node_modules", FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath,"node_modules"))//contentRootPath是根目录 });
之后在页面中再引用需要的链接
<link href="~/node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
前端完成验证