Angular 语言服务在 VSCode 中不起作用。在 HTML 中,使用F12转到组件时没有智能感知。
将tsconfig.json
在VSCode打开时没有给出错误。
有时,当我在构建服务器上使用 nx 构建 Angular 应用程序时,会出现以下错误。
FATAL ERROR: v8::FromJust Maybe value is Nothing.
1: 00007FF6CA27412F napi_wrap+133311
2: 00007FF6CA20DD06 SSL_get_quiet_shutdown+63062
3: 00007FF6CA20EB9D node::OnFatalError+301
4: 00007FF6CAAD6BB5 v8::V8::FromJustIsNothing+53
5: 00007FF6CA131D2A v8::internal::Isolate::isolate_root_bias+15114
6: 00007FF6CA131BCD v8::internal::Isolate::isolate_root_bias+14765
7: 00007FF6CA12C000 v8::internal::WasmTableObject::WasmTableObject+42832
8: 00007FF6CA2C6002 uv_pipe_pending_type+4242
9: 00007FF6CA2D0AA0 uv_loop_init+1024
10: 00007FF6CA2D0D4A uv_run+202
11: 00007FF6CA14CD3D v8::internal::interpreter::BytecodeLabel::bind+35501
12: 00007FF6CA1487F8 v8::internal::interpreter::BytecodeLabel::bind+17768
13: 00007FF6CA2C152D uv_poll_stop+557
14: 00007FF6CB071860 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+146368
15: 00007FFB6EBB84D4 BaseThreadInitThunk+20
16: 00007FFB71511821 RtlUserThreadStart+33
Run Code Online (Sandbox Code Playgroud)
我认为它与连接有关,因为堆栈跟踪与 lib_uv 相关,并且它在应该返回 Maybe 的地方返回 null。
这是一个节点错误还是与 Angular 或 nx 有关?此错误在以下版本中出现
18.17.1 …
我有一个角度的应用程序,要求从天蓝色的令牌。登录进展顺利,我得到了令牌。现在,此令牌已从角度应用程序发送到网络核心webapi应用程序。网络核心应验证此令牌,但失败。我认为webapi还应该联系azure来验证令牌,因为它不知道验证令牌所需的私钥和公钥。
目前尚不清楚为什么它会失败。angular应用程序和webapi都在我的计算机上本地运行。
错误是: Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: 'IDX10500: Signature validation failed. No security keys were provided to validate the signature.'
我的净核心2配置是:
var tokenValidationParameters = new TokenValidationParameters
{
RequireExpirationTime = true,
RequireSignedTokens = false,
ValidateIssuerSigningKey = true,
ValidateIssuer = true,
ValidIssuer = "8d708afe-2966-40b7-918c-a39551625958",
ValidateAudience = true,
ValidAudience = "https://sts.windows.net/a1d50521-9687-4e4d-a76d-ddd53ab0c668/",
ValidateLifetime = false,
ClockSkew = TimeSpan.Zero
};
services.AddAuthentication(options =>
{
options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
}).AddJwtBearer(options =>
{
options.Audience = "8d708afe-2966-40b7-918c-a39551625958";
options.ClaimsIssuer = "https://sts.windows.net/a1d50521-9687-4e4d-a76d-ddd53ab0c668/";
options.RequireHttpsMetadata=false;
options.TokenValidationParameters = tokenValidationParameters;
options.SaveToken = true;
});
Run Code Online (Sandbox Code Playgroud) azure-active-directory .net-core asp.net-core-webapi asp.net-core-2.0
我尝试了许多角度adal库,但令牌的更新不是自动完成的.
这是我使用的配置.
在package.json中
"@types/adal": "^1.0.29",
"@types/adal-angular": "^1.0.0",
"adal-angular": "^1.0.17",
Run Code Online (Sandbox Code Playgroud)
adal-angular带有两个脚本adal.js
和adal-angular.js
.我认为adal.angular.js
仅适用于旧angularjs
解决方案.所以我使用了adal.js和一个包装@ types/adal.
并包括adal.js
在.angular-cli.json
"scripts": [
"../node_modules/adal-angular/lib/adal.js"
],
Run Code Online (Sandbox Code Playgroud)
在我的angular 5应用程序中,我使用adal登录并向另一个URL上的网站发出请求api请求.
使用的配置
JwtConfig: {
tenant: "a1d50521-9687-4e4d-a76d-xxxxxxxxx",
clientId: "8d708afe-2966-40b7-918c-xxxxxxxx",
isAngular: true
},
Run Code Online (Sandbox Code Playgroud)
我的authService看起来像
import { } from "adal";
@Injectable()
export class AuthService {
private _config: adal.Config;
private _context: adal.AuthenticationContext;
constructor() {
Logging = {
level: 3,
log: function (message) {
console.log(message);
}
};
this._config = environment.JwtConfig;
this._context = new AuthenticationContext(this._config);
}
Run Code Online (Sandbox Code Playgroud)
不需要日志记录,但启用adal.js日志记录
很多示例在localstorage中存储令牌,但此令牌仅在1小时内有效.为了解决这个问题,我每次都调用acquireToken.如果它已过期,它将为我提供缓存的令牌或续订令牌. …
如何从命令行为单个测试运行xunit for asp.net 5
VS 2015就是这样的
dnx.exe --appbase "\Mvc\test\Microsoft.AspNet.Mvc.IntegrationTests" Microsoft.Framework.ApplicationHost --port 9543 Microsoft.Framework.TestHost --port 11883 run --test Microsoft.AspNet.Mvc.IntegrationTests.ActionParameterIntegrationTest.ActionParameter_NonSettableArrayModel_EmptyPrefix_DoesNotGetBound
如果我跑这个没什么事情发生的
在 devops server 2019 或 devops server 2020 的发布管道中使用任务“下载构建工件”时出现此错误:
Error: in getBuildApi, so retrying => retries pending : 4
使用诊断日志和/或main.js
在agent\_work\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb
目录中添加日志语句时可以找到详细的错误:
Failed in getBuildApi with error: Error: unable to get local issuer certificate
和
at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:1092:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:609:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:439:38) code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'```
Run Code Online (Sandbox Code Playgroud) angular ×3
.net-core ×1
adal.js ×1
angular5 ×1
asp.net-core ×1
certificate ×1
intellisense ×1
node.js ×1
xunit.net ×1