F5 не удалось во время отладки, показывая: предварительная сборка "build" была прервана, код выхода равен 1.
Я пробовал несколько вариантов этого, но ни один из них, кажется, не работает , Любые идеи? Искренне спросите!
Ошибка расширения C # отображается в правом нижнем углу vscode, сообщение об ошибке выглядит следующим образом
Starting OmniSharp server at 2020/4/30 下午3:01:54
Target: e:\VisualStudioCode\C#
OmniSharp server started.
Path: C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\OmniSharp.exe
PID: 1952
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.4 - "C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.4 - "C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\.msbuild
MSBuildToolsPath = C:\Users\El Psy\.vscode\extensions\ms-dotnettools.csharp-1.21.17\.omnisharp\1.35.1-beta.32\.msbuild\Current\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'e:\VisualStudioCode\C#'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'e:\VisualStudioCode\C#'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'e:\VisualStudioCode\C#\C#.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'e:\VisualStudioCode\C#'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: e:\VisualStudioCode\C#\C#.csproj
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'e:\VisualStudioCode\C#' on host 14876.
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Microsoft\Xamarin\NuGet\'.
在 NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1 fallbackPackageFolders)
在 Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()
在 Microsoft.NET.Build.Tasks.TaskBase.Execute()
在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'e:\VisualStudioCode\C#\C#.csproj'.
e:\VisualStudioCode\C#\C#.csproj
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(234,5): Error: The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Microsoft\Xamarin\NuGet\'.
在 NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1 fallbackPackageFolders)
在 Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()
在 Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()
在 Microsoft.NET.Build.Tasks.TaskBase.Execute()
在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: e:\VisualStudioCode\C#\C#.csproj
tasks. json
{//tasks.json
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "shell",
"args": [
"build",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
launch.json;
{
// launch.json;
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"WARNING01": "*********************************************************************************",
"WARNING02": "The C# extension was unable to automatically decode projects in the current",
"WARNING03": "workspace to create a runnable launch.json file. A template launch.json file has",
"WARNING04": "been created as a placeholder.",
"WARNING05": "",
"WARNING06": "If OmniSharp is currently unable to load your project, you can attempt to resolve",
"WARNING07": "this by restoring any missing project dependencies (example: run 'dotnet restore')",
"WARNING08": "and by fixing any reported errors from building the projects in your workspace.",
"WARNING09": "If this allows OmniSharp to now load your project then --",
"WARNING10": " * Delete this file",
"WARNING11": " * Open the Visual Studio Code command palette (View->Command Palette)",
"WARNING12": " * run the command: '.NET: Generate Assets for Build and Debug'.",
"WARNING13": "",
"WARNING14": "If your project requires a more complex launch configuration, you may wish to delete",
"WARNING15": "this configuration and pick a different template using the 'Add Configuration...'",
"WARNING16": "button at the bottom of this file.",
"WARNING17": "*********************************************************************************",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}