小编DFB*_*rry的帖子

VSCode 扩展 - 如何更改文件的文本

我有一个扩展程序,可以获取打开文件的文本并对其进行更改。更改文本后,如何将其放回 VSCode 中显示的文件中?

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

  // Use the console to output diagnostic information (console.log) and errors (console.error)
  // This line of code will only be executed once when your extension is activated
  console.log('Congratulations, your extension "myExtension" is now active!');
  console.log(process.versions);

  // The command has been defined in the package.json file
  // Now provide the …
Run Code Online (Sandbox Code Playgroud)

visual-studio-code vscode-extensions

15
推荐指数
3
解决办法
7477
查看次数

Nunit没有在Visual Studio调试模式下运行SetUp方法

我在调用setup方法后尝试调试测试,测试依赖于调用的setup方法.

我正在使用Nunit 2.6.0.12051测试.Net 4.0类库.nunit Visual Studio项目有一个标有[SetUpFixture]的类和一个标有[SetUp]的方法.

如果我从NUnit gui运行测试,我相当肯定会调用set属性类(因为它现在没有在安装程序类中停止运行时错误)但是我无法调试它.如果我尝试更改设置以查看详细跟踪,NUnit gui会抛出未处理的摘要.

如果我通过Test View/Debug Selection从Visual Studio运行测试,则setup方法的断点不会停止执行,并且方法内的trace语句不会在调试窗口中打印.所以我确定设置方法没有被调用.

虽然我可以将安装程序类更改为所有测试类的基础,但我只需要运行一次方法.

任何帮助都会很精彩.

installation nunit unit-testing visual-studio-2010

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

Azure Build失败:无法删除目录"csx\Debug \"

昨晚我去睡觉时,Box正坐在断点上.今天早上有服务更新关闭VS. 我重新打开VS,做一些准备调试,然后构建.生成失败:错误MSB3231:无法删除目录"csx\Debug \".访问路径"Microsoft.WindowsAzure.Diagnostics.dll"被拒绝.

VS正在管理员模式下运行.

build updates azure visual-studio-2010

7
推荐指数
2
解决办法
3855
查看次数

错误:模块“DynamicTestModule”声明了意外值“未定义”

在我的 Angular/Typescript/Webpack 项目中,我在代码修改后重写了单元测试。

该问题的症状是运行非常基本的组件测试时出现错误:“错误:模块‘DynamicTestModule’声明了意外值‘未定义’”

为了调试这个问题,我最终从组件的构造函数中删除了所有依赖项,并且基本上删除了所有代码。该组件什么也没做,但我仍然收到错误。它不可能是循环依赖,因为不存在依赖。

文件夹文件是:

--profile
----profile.component.ts
----profile.component.spec.ts
----profile.component.html
----index.ts (barrel)
Run Code Online (Sandbox Code Playgroud)

该组件(为了找出问题而删除了最有意义的代码)是:

import { Component } from '@angular/core';
@Component({
    selector: 'profile',
    template: `<h1></h1>` 
})
export class ProfileComponent {
    title = 'Test Tour of Heroes';
    constructor(){}
}
Run Code Online (Sandbox Code Playgroud)

规格是:

import { NO_ERRORS_SCHEMA, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } 
  from '@angular/core/testing';

import { ProfileComponent } from './profile.component';

console.log(ProfileComponent);

fdescribe('Component: Jasmine Spy Test', () => { 

  console.log(ProfileComponent);

  let fixture: ComponentFixture<ProfileComponent>;
  let component: ProfileComponent;
  let fixture2: ComponentFixture<ProfileComponent>;

  beforeEach(() => {
    TestBed.configureTestingModule({ …
Run Code Online (Sandbox Code Playgroud)

unit-testing include angularjs typescript webpack

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

GH cli - 如何获取当前仓库?

使用 GitHub cli (gh),如何获取当前的存储库名称?

我可以获取我拥有的存储库的列表,但如何获取当前的存储库?

github repo github-cli

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

iTextSharp Nest Tables,内表不是100%宽度?

我在其自己的类库中使用带有iTextSharp的asp.net 4.0.从属性,运行时版本v2.0.50727,版本5.3.0.0.

当我嵌套两个表时,内表有一个我无法控制的自动边距或填充.如何让两张桌子都100%?

//编辑

public PdfPTable GetHeaderInnerTable(Rectangle pageSize)
{
// create 2 table cell
// left cell for Report Header text
// right cell for microsoft internal only image
int columnCount = 2;


PdfPTable table = new PdfPTable(columnCount);
table.TotalWidth = 792;
//table.WidthPercentage = 100; // 80 is default - THIS IS THE ANSWER TO MAKE INNER TABLE 100%
float[] widthColumns = new float[] { 652, 140 }; //left edge of second column is where image should be
table.SetTotalWidth(widthColumns);

// Left …
Run Code Online (Sandbox Code Playgroud)

asp.net itext

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

本地 UWP 客户端到本地 asp.net core api web 服务器 - 证书颁发机构无效或不正确

我正在接管别人的项目并试图让前端(UWP)与后端(asp.net core 2.x api)对话。

它们独立工作,后端在调试时打开浏览器到正确的路由https://localhost:44319/api/status。当我尝试将前端连接到后端时,我得到The certificate authority is invalid or incorrect

该代码使用 HttpClient。

HttpClient client = new HttpClient(new 
HttpClientHandler() { UseDefaultCredentials = true });
var uri = new Uri(string.Format(accountListServiceUri, string.Empty));
var response = await client.GetAsync(uri);
Run Code Online (Sandbox Code Playgroud)

我正在通过 IISExpress 运行后端,并使用以下 powershell 脚本来获取 IIS Express 开发证书的缩略图。

View certificate Copy Set-Location Cert:\LocalMachine\My Get-ChildItem | Format-Table Subject, FriendlyName, Thumbprint
Run Code Online (Sandbox Code Playgroud)

我使用缩略图制作了一个 pfx 文件。

Get-ChildItem -Path cert:\localMachine\my\<THUMBNAIL> | Export-PfxCertificate -FilePath C:\<PROJECTNAME>.pfx -Password $mypwd
Run Code Online (Sandbox Code Playgroud)

然后我根据不同的 SO 答案将 pfx 导入受信任的根证书颁发机构和受信任的人。

认为服务器设置正确,但客户端没有。我想在不输入 #debug 代码的情况下解决这个问题,因为它不会通过安全检查。

感谢您的任何帮助。

c# asp.net certificate client-certificates uwp

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