小编Bmo*_*moe的帖子

如何在 .NET Framework 4.7.1 中使用 Azure KeyVault 覆盖 Web.config 值

如何在 ASP.NET Framework 4.7.1 WebForms 应用程序中实现 Microsoft 的 Azure KeyVault,以使用web.configKeyVault 中的值覆盖其中的值?我确实看到参考资料表明我们需要最低版本的 .NET Framework 4.7.1 才能做到这一点,但 Microsoft 提供的示例适用于 .NET Core。我的配置是web.config文件而不是appsettings.json. 我也有Global.asax.cs文件而不是Startup.csProgram.cs

c# .net-4.0 azure-keyvault .net-4.7.1

11
推荐指数
1
解决办法
1万
查看次数

如何使用 Karma Test Runner 显示渲染组件?

我使用 cli 和默认值创建了一个新的 Angular 应用程序 v13。我替换了 app.component.html 文件以显示 4 个图像。这可以通过 npm start 很好地加载到浏览器中。当我运行 npm test 并运行检查这些图像是否存在(使用类选择器)的测试时,测试通过了,但我在 Karma chrome 浏览器窗口中看不到图像。使用开发工具我看到它们已加载。

一般来说,如何让组件 dom 显示在 Karma Chrome 页面上?

编辑:这是一些代码

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'flopbuster_basics';
}
Run Code Online (Sandbox Code Playgroud)

app.component.css

.fit-picture {
    width: 250px;
}
Run Code Online (Sandbox Code Playgroud)

app.component.html

<div class="posters">
  <span class="poster">
    <img class="fit-picture" src="assets/images/posters/cloudy.jpg" alt="Cloudy With a Chance of Meatballs">
  </span>
  <span class="poster">
    <img class="fit-picture" src="assets/images/posters/luca.jpg" alt="Luca">
  </span>
  <span class="poster">
    <img …
Run Code Online (Sandbox Code Playgroud)

unit-testing karma-jasmine angular

8
推荐指数
1
解决办法
2614
查看次数

Powershell New-NfsShare 无效的命名空间

我正在尝试使用 New-NfsShare 命令创建网络共享,但我不断收到无效的命名空间错误。我从提供的例子中几乎是逐字逐句地写的,所以我不明白出了什么问题。

例子: New-nfsShare -Name "NFSshare01" -Path "C:\shares\NFSshare01"

我的代码: New-NfsShare -Name "LABS" -Path "C:\LABS" -Permission readwrite

有谁知道发生了什么?我已经将 NFS 模块导入到 Powershell 中,我什至尝试先创建目录,因为某些原因,该命令在进行网络共享之前无法创建该项目。我使用的是 Windows Server 2012 和 powershell 3.0 版

powershell network-share

5
推荐指数
1
解决办法
3331
查看次数

如何在 .NET Core 中只使用 Kestrel

从 Visual Studio 2019 创建新的 .NET Core 应用程序使我的应用程序在调试时使用 iisexpress 运行。我计划部署到 Linux,因此只想使用 Kestrel 在我的 Win7 机器上进行开发,然后使用自包含部署(我相信将使用 Kestrel)部署到 Linux 服务器。

当我在 Win7 上开发时,我需要做什么才能将我的应用程序配置为仅使用 Kestrel 而不是 IIS?

编辑:当我单击向下箭头并从 IIS Express 更改为应用程序名称时,我收到此错误

开发证书错误

linux kestrel .net-core asp.net-core

2
推荐指数
1
解决办法
2351
查看次数

模块ag-grid-angular / main没有导出的成员AgGridNg2.ts

我将ag-grid安装到我的Angular 7应用程序中,并遵循有关为ag-grid 启用选择的ag-grid教程。当我尝试导入时,AgGridNg2我得到了Module ag-grid-angular/main has no exported member AgGridNg2.ts。我只能假设此插件的文档已过时。我需要解决什么才能使其正常工作?这是我的component.ts:

import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { AgGridNg2 } from 'ag-grid-angular';

@Component({
  selector: 'app-sample',
  templateUrl: './sample.component.html',
  styleUrls: ['./sample.component.css']
})
export class SampleComponent implements OnInit {
  @ViewChild('agGrid') agGrid: AgGridNg2;
      columnDefs = [
        {headerName: 'Make', field: 'make', sortable: true, filter: true, checkboxSelection: true },
        {headerName: 'Model', field: 'model', sortable: true, filter: true },
        {headerName: 'Price', field: 'price', sortable: …
Run Code Online (Sandbox Code Playgroud)

ag-grid angular

2
推荐指数
1
解决办法
764
查看次数

JwtSecurityToken 过期时间无效 .NET Core 3.1

我将我的应用程序从 .NET Core 2.2 升级到 .NET Core 3.1。当我尝试使用 PostMan 测试我的端点时,我注意到收到 401 Unauth 错误。当我查看标题时,我发现到期时间无效:

令牌无效

我获取了以下不记名令牌:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiQm9iIiwibmJmIjoiMTYxNzk3Nzg1MSIsImV4cCI6IjE2MjMxNjE4NTYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOlsiQmFza2V0YmFsbCIsIlJ1Z2J5IiwiRm9vdGJhbGwiXX0.QRLuXFeopf7QZ1NUzWcctuSfnNXiPgc2UH7NxAuHYvw
Run Code Online (Sandbox Code Playgroud)

我正在生成令牌端点并使用jwt.io对其进行解码,exp 字段为“1623161856”。 解码令牌 我将其转换为 Javascript 中的日期对象,它等于未来 60 天。 转换后的exp时间

所以token肯定没有过期。不确定我在升级到 .NET Core 3.1 时是否遗漏了任何内容,但这里是相关代码:

Startup.cs我有

   public void ConfigureServices(IServiceCollection services)
    {


        // Initial Setup
        services.AddMvc();
        services.AddSingleton<IConfiguration>(Configuration);
        // Call this in case you need aspnet-user-authtype/aspnet-user-identity
        services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
        // Register the Swagger generator, defining one or more Swagger documents 
        services.AddSwaggerGen(c =>
        {
            c.SwaggerDoc(Configuration["v1"], new OpenApiInfo { Title = Configuration["Sports"], Version = Configuration["v1] });
        });

        services.AddDataProtection();
        
        //Authentication …
Run Code Online (Sandbox Code Playgroud)

c# authentication asp.net-authorization jwt asp.net-core

2
推荐指数
1
解决办法
1193
查看次数

Angular Import Javascript files into one Javascript File

In Angular 8, I am importing bootstrap css files into my styles.css file like so:

/* You can add global styles to this file, and also import other style files */
@import "~bootstrap/dist/css/bootstrap.min.css";
@import "~font-awesome/css/font-awesome.min.css";
Run Code Online (Sandbox Code Playgroud)

However I have a js file called main.js and I want to do the same for the js dependencies but the browser says there is a syntax error on line 1. main.js looks like this:

@import "~jquery/dist/jquery.slim.min.js";
@import "~popper.js/dist/popper.min.js";
@import "~bootstrap/dist/js/bootstrap.min.js";
Run Code Online (Sandbox Code Playgroud)

And then I plan …

javascript angular

1
推荐指数
1
解决办法
47
查看次数