web-dev-qa-db-ja.com

vscodeとC#拡張を含むUbuntu 19.10上のUnity3D:エラーが発生し、オートコンプリートが機能しない

私はWeb開発者です(symfony <3;)C#とMicrosoftテクノロジーは私にとって新しいものです! )そしてcovidの封じ込め中に、ゲームエンジンの単一性を備えたシンプルなゲームを作成したい

Ubuntu 19.10で、unity Hub v2.3.0をダウンロードしました(- https://unity3d.com/get-unity/download

Unityハブから、unity3D v2019.3.7f1(最新の安定版)をいくつかのオプション(Linux&WebGL)でインストールしました&Windowsビルドサポート

enter image description here

シンプルな2Dゲームを作成しました

enter image description here

すべてが魅力のように機能し、プロジェクトを開いて、Unity3Dコンソールでエラーなしに新しいゲームを実行できます

Unityからc#スクリプトを作成すると、(非常にシンプルな)テキストエディターgeditでファイルを開くことができます。ここで、クロスOSをインストールしたいと思いますIDE visualcodeおかげで、Unityスクリプトを編集すると、便利な拡張機能とオートコンプリートコードが得られます。

それで、apt installを介してvscodeをインストールしました(この公式ガイドに従いました: https://code.visualstudio.com/docs/setup/linux

Vscodeの私のバージョンは:

enter image description here

いくつかのWeb検索の後、.NETフレームワークをインストールする必要があることを理解しました(たぶん私は間違っていますか?)

enter image description here

私のdotnetバージョン(ターミナルから:dotnet --version)は3.1.201です

次に、デフォルトのテキストエディターを変更するためのunityパラメーターを構成しました。

enter image description here

  • 外部スクリプトエディター:コード
    • コードはパス/ usr/bin/code、vscodeの実行可能ファイルを参照します
  • 外部スクリプトエディタの引数: "$(ProjectPath)" -g "$(File)":$(Line):$(Column)
    • デフォルトの値、私は何も変更しませんでした

Unityから単純なc#スクリプトを作成し、ファイルを開き、vscodeを自動的に開きました(そうです!)。 vscodeから2つのパブリック変数を追加しました(ブール 'a'とRigidbody2D 'b')

enter image description here

スクリプトを保存してUnityアプリに移動すると、変数aおよびbがインターフェイスに表示されます。

enter image description here

すべての作品!しかし、今は、vscodeのオートコンプリートコードが必要です。それで、vscode c#拡張機能をインストールしました。しかし、インストールが完了すると、次のメッセージが表示されます。

enter image description here

ログ全体は次のとおりです。

Starting OmniSharp server at 4/2/2020, 8:10:51 PM
    Target: /home/okli/UnityProjects/SampleGame/SampleGame.sln

OmniSharp server started.
    Path: /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/run
    PID: 15372

[info]: OmniSharp.Stdio.Host
    Starting OmniSharp on ubuntu 19.10 (x64)
[info]: OmniSharp.Services.DotNetCliService
    DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Located 1 MSBuild instance(s)
        1: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    MSBUILD_EXE_PATH environment variable set to '/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Registered MSBuild instance: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin
        CscToolPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Roslyn
        BypassFrameworkInstallChecks = true
        MSBuildExtensionsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
    Detecting Cake files in '/home/okli/UnityProjects/SampleGame'.
[info]: OmniSharp.Cake.CakeProjectSystem
    Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
    Detecting projects in '/home/okli/UnityProjects/SampleGame/SampleGame.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
    Queue project update for '/home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
    Detecting CSX files in '/home/okli/UnityProjects/SampleGame'.
[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.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.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
    Configuration finished.
[info]: OmniSharp.Stdio.Host
    Omnisharp server running using Stdio at location '/home/okli/UnityProjects/SampleGame' on Host 14406.
[info]: OmniSharp.MSBuild.ProjectManager
    Loading project: /home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Animation.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.PixelPerfect.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.SpriteShape.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Path.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'UnityEngine.UI.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Timeline.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Animation.Triangle.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'PsdPlugin.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Rider.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Mathematics.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Psdimporter.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.InternalAPIEngineBridge.001.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Common.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.SpriteShape.Runtime.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.PixelPerfect.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Animation.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.Mathematics.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.TextMeshPro.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.2D.Common.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'Unity.InternalAPIEditorBridge.001.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
    The referenced project 'UnityEditor.UI.csproj' does not exist.
[fail]: OmniSharp.MSBuild.ProjectLoader
    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
    Failed to load project file '/home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj'.
/home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Animation.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.PixelPerfect.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.SpriteShape.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Path.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'UnityEngine.UI.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Timeline.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Animation.Triangle.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'PsdPlugin.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Rider.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Mathematics.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Psdimporter.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.InternalAPIEngineBridge.001.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Common.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.SpriteShape.Runtime.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.PixelPerfect.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Animation.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.Mathematics.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.TextMeshPro.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.2D.Common.Editor.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'Unity.InternalAPIEditorBridge.001.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1870,5): Error: The referenced project 'UnityEditor.UI.csproj' does not exist.
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1193,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

[fail]: OmniSharp.MSBuild.ProjectManager
    Attempted to update project that is not loaded: /home/okli/UnityProjects/SampleGame/Assembly-CSharp.csproj

何かが機能しないようです...しかし、c#スクリプトを変更して保存できます(例として新しいパブリック変数を追加し、変数はユニティインターフェイスに追加されます)が、public Rigidbodを入力するとオートコンプリートコードが機能しませんctrl + spaceを押してください。オートコンプリートのヘルプは表示されません。

C#/ vscode/Microsoftテクノロジーに慣れていないので、(悪い)ソリューションを試す前に、何かを忘れたり、何か間違ったことをしたりするか、ここで質問することをお勧めします

助けてくれてありがとう!

編集:私はこのエラーをunity3Dインターフェイスで通知しました

enter image description here

このエラーについていくつか検索します...

0xBFE1A8回答後の編集:

  • 新しいプロジェクト「プロップ」を作成しました
  • UnityEditorで、Visual Studio Code Editorのバージョンを1.1.3に変更し、[Update 1.1.3]ボタンをクリックします

エラーが消えないので、私は続けました:

  • 「Packages/manifest.json」で「com.unity.ide.vscode」を1.1.3に変更しました
  • UnityEditorで、[Generate all .csproj files]チェックボックスがオンになっている
  • 次に、[Assets]メニューの[Reimport All]をクリックします

これらすべての後、vsecodeのオートコンプリートコードは機能しませんが、エラーログは小さくなります。

Starting OmniSharp server at 4/5/2020, 6:56:52 PM
    Target: /home/okli/UnityProjects/plop/plop.sln

OmniSharp server started.
    Path: /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/run
    PID: 30149

[info]: OmniSharp.Stdio.Host
    Starting OmniSharp on ubuntu 19.10 (x64)
[info]: OmniSharp.Services.DotNetCliService
    DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Located 1 MSBuild instance(s)
        1: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    MSBUILD_EXE_PATH environment variable set to '/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    Registered MSBuild instance: StandAlone 16.4 - "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin"
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin
        CscToolPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Roslyn
        BypassFrameworkInstallChecks = true
        MSBuildExtensionsPath = /home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
    Detecting Cake files in '/home/okli/UnityProjects/plop'.
[info]: OmniSharp.Cake.CakeProjectSystem
    Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
    Detecting projects in '/home/okli/UnityProjects/plop/plop.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
    Queue project update for '/home/okli/UnityProjects/plop/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
    Detecting CSX files in '/home/okli/UnityProjects/plop'.
[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.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.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
    Configuration finished.
[info]: OmniSharp.Stdio.Host
    Omnisharp server running using Stdio at location '/home/okli/UnityProjects/plop' on Host 30017.
[info]: OmniSharp.MSBuild.ProjectManager
    Loading project: /home/okli/UnityProjects/plop/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
    Failed to load project file '/home/okli/UnityProjects/plop/Assembly-CSharp.csproj'.
/home/okli/UnityProjects/plop/Assembly-CSharp.csproj
/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16/.omnisharp/1.34.15/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1193,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

[fail]: OmniSharp.MSBuild.ProjectManager
    Attempted to update project that is not loaded: /home/okli/UnityProjects/plop/Assembly-CSharp.csproj
3
matthieu lopez

私は同じ問題を抱えていましたが、MonoVersionとは関係がありませんでした。 1.1.3およびへのダウングレードcsprojファイルの生成で問題が解決しました。このエラーは1.1.4バージョンに関連しているため、私は奇妙なことに気付き、さらに1.2の調査を開始しました。 vscode拡張の1。問題はslnファイルにあり、簡単な解決策を見つけました。

UnityEditorに移動します:[Edit]-> [Preferences]-> [External Tools]:チェックボックスをクリックしてGenerate .csproj files for:Embedded packages、次にRegenerate project filesbutton toオートコンプリートの問題を解決します。

enter image description here

Slnファイルにいくつかの行が追加され、オートコンプリートは拡張機能をダウングレードする必要なく機能するようになりました。

それが役に立てば幸い!

0
Rafael Raposo