我有一个节点项目作为我的主项目中的子文件夹。我正在尝试为 VS Code 创建启动配置,以便在我打开父文件夹时它开始调试 index.ts 文件。我的文件夹结构如下:

所以我的节点项目位于名为 NodeBackend 的子文件夹中。我想按 VS Code 上的 F5 或绿色按钮并开始调试我的打字稿文件。
当我从父文件夹中执行此操作时,出现错误:
Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
Run Code Online (Sandbox Code Playgroud)
但是,当我在 VS 代码中加载“NodeBackend”项目并按 F5 或绿色按钮时,我可以毫无问题地调试它。
我的启动.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}\\NodeBackend",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\NodeBackend\\src\\index.ts",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
这是我的源代码: https: //github.com/Kayes-Islam/SimpleProject
我正在关注此页面以及 Xamarin.Auth github 存储库中的一些示例,因此设置了 Facebook 登录。我创建了以下登录功能:
public void Authenticate()
{
string clientId = Config.FacebookAppID;
string redirectUri = redirectUri = "MyApp:/authorize";
var authenticator = new OAuth2Authenticator(
clientId: clientId,
scope: "public_profile,email",
authorizeUrl: new Uri("https://www.facebook.com/v2.9/dialog/oauth"),
redirectUrl: new Uri(redirectUri),
getUsernameAsync: null,
isUsingNativeUI: true);
authenticator.AllowCancel = true;
authenticator.Completed += OnAuthCompleted;
authenticator.Error += OnAuthError;
Authenticator = authenticator;
var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
presenter.Login(Authenticator);
}
Run Code Online (Sandbox Code Playgroud)
但我在最后一行收到以下异常:
{System.NullReferenceException: Object reference not set to an instance of an object.
at Xamarin.Auth.Presenters.OAuthLoginPresenter.Login (Xamarin.Auth.Authenticator authenticator) [0x00011] in C:\cxa\source\Xamarin.Auth.LinkSource\Request.cs:290
at …Run Code Online (Sandbox Code Playgroud) 我已经从这里找到的角度通用模板开始构建了我的项目: Universal-starter
我正在尝试将ssr构建部署为azure Web应用程序。我的代码在VSTS上。
在我的本地计算机上,我可以运行以下命令:
npm installnpm run build:ssr。这将产生dist文件夹。node server.js该应用程序在本地计算机上的端口4000上启动。
因此,按照上述步骤,我在VSTS上创建了一个构建过程,其中包含以下任务:
npm installnpm run build:ssr上面的过程成功运行,但是当我导航到https://my-site-name.azurewebsites.net/时,无法访问该站点。
如何在Azure上成功部署Angular 5 SSR?
更新: 由于此NodeJS-EmptySiteTemplate在azure上运行而没有错误,因此我对该项目进行了以下更改:
但是我没有得到:“由于发生内部服务器错误,因此无法显示该页面。”
我正在尝试使用 PKCE 一个有角度的项目来实现授权代码流。我正在使用 angular-auth-oidc-client。我们已经有一个基于 IdentityServer4 的现有内部实施,客户端可以很好地配合该实施,但我们现在正在尝试将身份验证迁移到 Azure AD B2C,而不是在内部实施。
我已经配置了 Azure AD B2C 和我的客户端应用程序。这是配置:

这是我在客户端 OIDC 服务上的配置:
oidcConfigService.withConfig({
stsServer: 'https://login.microsoftonline.com/mycompany.onmicrosoft.com/v2.0',
authWellknownEndpoint:
'https://mycompany.b2clogin.com/mycompany.onmicrosoft.com/B2C_1_SignUpSignIn/v2.0/.well-known/openid-configuration',
redirectUrl: window.location.origin,
postLogoutRedirectUri: window.location.origin,
clientId: 'client-id-guid-goes-here',
scope: 'openid profile offline_access',
responseType: 'code',
silentRenew: true,
autoUserinfo: false,
silentRenewUrl: window.location.origin + '/silent-renew.html',
logLevel: LogLevel.Debug,
renewTimeBeforeTokenExpiresInSeconds: 60
});
Run Code Online (Sandbox Code Playgroud)
即使我在客户端配置中选中了 accesss_token 复选框。我在这里缺少什么?
access-token openid-connect azure-ad-b2c pkce angular-auth-oidc-client
我有一个带有一堆项目的导航抽屉,我希望注销项目与抽屉的最底部对齐。
return Drawer(
child: Column(
children: [
DrawerAccountHeader(UserType.worker),
DrawerNavigationItem(
"Home",
Icons.home,
),
new ListTile(
title: new Text('Jobs', style: TextStyle(color: Colors.black54),),
dense: true,
),
DrawerNavigationItem(
"Nearby",
Icons.location_on,
),
DrawerNavigationItem(
"Applied",
Icons.check_circle_outline,
),
DrawerNavigationItem(
"Hired",
Icons.check_circle,
),
Expanded(child: Container()),
Divider(),
DrawerNavigationItem(
"Logout",
Icons.exit_to_app,
)
],
),
);
Run Code Online (Sandbox Code Playgroud)
但在较小的屏幕上,我收到溢出错误,因为最上面的列高度大于屏幕高度。因此,我尝试将列更改为列表框,然后出现异常“垂直视口被赋予无界高度”,因为我在项目之间有 Expanded() 来形成间隙,以便登录按钮粘在列表的底部。
下面有什么办法可以实现吗?
我正在尝试测试我从这里阅读最多的 MVC4 异步控制器操作:http : //www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4
下面是我的控制器:
public class HomeController : AsyncController
{
//
// GET: /Home/
public async Task<ActionResult> Index()
{
WriteOnFile("Here dude. Time: " + DateTime.Now.ToString("HH:mm:ss:fff"));
await Task.Delay(10000);
return View();
}
private void WriteOnFile(string text)
{
using (Mutex mutex = new Mutex(false, "TempFile"))
{
mutex.WaitOne();
using (var writer = new StreamWriter(@"D:\Temp\temp.txt", true))
{
writer.WriteLine(text);
}
mutex.ReleaseMutex();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我正在通过打开指向 ~/home/index 的 5 个浏览器选项卡并一次刷新它们来测试这一点。
以下是我得到的输出:
时间戳相隔 10 秒。这意味着在前一个请求完成后处理每个请求。这就是同步控制器动作所做的,但我希望异步控制器动作能够在等待时处理请求。为什么 async 在上面的例子中不起作用?我做错了什么?
我在带有 .net 4.5 …
access-token ×1
angular5 ×1
asynchronous ×1
azure ×1
azure-ad-b2c ×1
azure-devops ×1
c# ×1
flutter ×1
node.js ×1
pkce ×1
ssr ×1
xamarin ×1
xamarin.auth ×1