我不确定如何将Visual Studio Code中的.net核心项目的默认nuget提要设置为https://api.nuget.org/v3/index.json
当我尝试添加程序包(并随后恢复依赖关系)时,出现以下错误...
C:\Program Files\dotnet\sdk\2.1.403\NuGet.targets(114,5): error : Unable to load the service index for source https://smartassessor.pkgs.visualstudio.com/_packaging/SANuget/nuget/v3/index.json. [c:\Users\Matthew.OConnor\Desktop\Important Documents\Programming\DatingApp\DatingApp.API\DatingApp.API.csproj]
C:\Program Files\dotnet\sdk\2.1.403\NuGet.targets(114,5): error : Response status code does not indicate success: 401 (Unauthorized). [c:\Users\Matthew.OConnor\Desktop\Important Documents\Programming\DatingApp\DatingApp.API\DatingApp.API.csproj]
Run Code Online (Sandbox Code Playgroud)
此源https://smartassessor.pkgs.visualstudio.com/_packaging/SANuget/nuget/v3/index.json与我当前的项目无关,但是它用于通常使用完整Visual Studio运行的其他项目。这些项目保存在与该项目完全不同的位置。
我只希望能够在.net核心项目中从nuget.org添加nuget包。如何在VS代码中执行此操作?
我目前在这个项目中没有nuget.config文件。
错误中提到的程序包源似乎来自我在使用Visual Studio时设置的程序包源
这是我的csproj文件...
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4"/>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="4.0.1"/>
<PackageReference Include="CloudinaryDotNet" Version="1.3.1"/>
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.1.0-preview1-final"/>
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
CloudinaryDotNet 是产生上述错误的软件包。
我正在尝试根据id属性设置角度模型值.如果"id"具有从服务获取数据的值,则设置默认值
ngOnInit() {
// tslint:disable-next-line:radix
let id = parseInt(this.route.snapshot.paramMap.get('id'));
this.departmentId = id;
if (id === NaN) {
// tslint:disable-next-line:max-line-length
this.departmentModel = new Department(1, 0, '', 'admin', new Date(2018, 11, 11), 'localhost', 'admin', new Date(2018, 11, 11), 'localhost');
} else {
this.departmentService.getDepartment(this.departmentId).subscribe(data => this.departmentModel = data);
}
}
Run Code Online (Sandbox Code Playgroud)
但它始终属于其他部分,即使"id"具有值.我该如何解决这个问题.任何帮助都会受到高度关注.
import pandas as pd
data = pd.read_csv(some_data)
Run Code Online (Sandbox Code Playgroud)
我在此代码的第二行中添加了一个断点,Visual Studio代码在此断点处停止。但是,当我尝试进入“ read_csv”函数时,vscode显然执行了“跳过”。我还尝试在“ read_csv”函数中设置断点,但结果相同。
那么,如何进入提到的功能呢?
当我尝试跑步时
我收到此错误:
main.cpp:1:18:致命错误:temp.h:没有此类文件或目录#include“ temp.h”编译终止。
但是,Intellisense会检测到此标头存在。
Ctrl +左键单击main.cpp中的#include“ temp.h”成功将我带到该文件,并且该代码行在其下面没有任何弯曲的行。
我为.cpp文件和头文件有两个单独的文件夹,并在c_cpp_properties.json中配置了includePath,如下所示: 
我的工作区文件夹是temp,“ $ {workspaceFolder} / **”行应递归地检查子文件夹中的标题。我将绝对路径添加到头文件没有成功。
我已经安装了dart(仅语法突出显示)扩展名,但没有突出显示我的dart代码。安装扩展名后,我已经重新启动了VS代码几次,但无法正常工作。有人请让我知道这个问题,我该如何解决。
以下是我的VS代码屏幕截图:
谢谢
我正在使用VSCode,Prettier和TSLint。
当我确实有多个函数调用时,例如
let m = moment().startOf("day").subtract(30, "days");
Run Code Online (Sandbox Code Playgroud)
更漂亮的闯入
let m = moment()
.startOf("day")
.subtract(30, "days")
Run Code Online (Sandbox Code Playgroud)
我已经设置了TSLint规则
{
"defaultSeverity": "warning",
"extends": ["tslint:recommended"],
"linterOptions": {
"exclude": ["node_modules/**"]
},
"rules": {
// ...
"newline-per-chained-call": false
}
}
Run Code Online (Sandbox Code Playgroud)
和休闲的设置
"prettier.tslintIntegration": true
Run Code Online (Sandbox Code Playgroud)
但是链接的功能仍在不断发展。
如何避免断线但仍使用TSLint?
因此,我创建了一个名为“ Node Projects”的新文件夹,并将其添加到VS Code的“ Workspace”中。然后,我创建了两个示例文件,分别称为“ test.js”和“ test2.js”。在这些文件中,我仅具有一个log命令即可确定正在运行的命令。
当我运行test.js时,出现错误消息“属性'程序'不存在(C:\ Users \ MyName \ Documents \ NodeProjects / Node Projects / test.js',所以我单击“打开launch.json”按钮,然后看到以下内容:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/Node Projects\\test.js"
}
]
}
Run Code Online (Sandbox Code Playgroud)
根据我在此处关于stackoverflow的搜索,我认为问题出在“程序”行,因此我将其更改为
"program": "${workspaceFolder}\\test.js"
所以现在,当我执行F5时,调试器将运行test.js,这很棒。但是因为test.js值是硬编码的,所以即使我在编辑器上打开test2.js并执行F5,它也会再次运行test.js!因此,我尝试从launch.json中删除文件名(即test.js)。但是现在当我尝试运行文件时,出现了“无法启动程序”错误。哦,删除launch.json还是没有帮助(它只是重新创建了初始的launch.json文件,我回到了第一个)。
我无法将Visual Studio Code设置为git的核心编辑器。当我尝试执行git commit时,我只会看到有关编辑器存在问题的信息。
MacBook-Air-Agata:~ agataskrzypczyk$ git config --global core.editor "/Applications/Visual Studio Code.app" --wait
MacBook-Air-Agata:~ agataskrzypczyk$ git config --global core.editor
/Applications/Visual Studio Code.app
MacBook-Air-Agata:~ agataskrzypczyk$ cd nowy
MacBook-Air-Agata:nowy agataskrzypczyk$ git commit
hint: Waiting for your editor to close the file... /Applications/Visual Studio Code.app: /Applications/Visual: No such file or directory
error: There was a problem with the editor '/Applications/Visual Studio Code.app'.
Please supply the message using either -m or -F option.
MacBook-Air-Agata:nowy agataskrzypczyk$
Run Code Online (Sandbox Code Playgroud) 当我通过shell运行时pylint:
$ pylint decorator.py
No config file found, using default configuration
************* Module decorator
C: 7, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C: 15, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C: 1, 0: Missing module docstring (missing-docstring)
C: 4, 0: Missing function docstring (missing-docstring)
C: 6, 4: Missing function docstring (missing-docstring)
C: 14, 0: Missing function docstring (missing-docstring)
Run Code Online (Sandbox Code Playgroud)
但是,如下所示,这些警告不会在VSCode中出现
...尽管实际上已经执行了一些基本检查,如下图所示,但我删除了空白行: