3
votes

Unity3D sur Ubuntu 19.10 avec vscode et extension C #: obtenez une erreur et la saisie semi-automatique ne fonctionne pas

Je suis développeur web (symfony <3;) Les technologies C # et Microsoft sont nouvelles pour moi! ) et pendant le confinement de covid, je veux créer un jeu simple avec l'unité du moteur de jeu

Sur Ubuntu 19.10 , j'ai téléchargé unity Hub v2.3.0 ( https://unity3d.com/get-unity/download )

Depuis le hub d'unité, j'ai installé unity3D v2019.3.7f1 (la dernière version stable) avec quelques options ( support de Linux & WebGL & windows build )

entrez la description de l'image ici

Et j'ai créé un jeu 2D simple

entrez la description de l'image ici

Tout fonctionne comme un charme, je peux ouvrir mon projet et lancer mon nouveau jeu sans aucune erreur dans la console unity3D

Depuis Unity, lorsque je crée un script ac #, le fichier peut être ouvert par mon (très simple) éditeur de texte gedit. Maintenant, je veux installer le visualcode cross-os IDE merci que je vais obtenir des extensions utiles et du code d'auto-complétion lorsque je modifierai mes scripts unit.

J'ai donc installé vscode via apt install (j'ai suivi ce guide officiel: https://code.visualstudio.com/docs/setup/linux )

Ma version de vscode est:

entrez la description de l'image ici

Après quelques recherches sur le Web, je comprends que je dois installer le framework .NET (peut-être que je me trompe?)

entrez la description de l'image ici

Ma version dotnet (à partir d'un terminal: dotnet --version) est 3.1.201

Ensuite, j'ai configuré le paramètre unité pour modifier l'éditeur de texte par défaut:

entrez la description de l'image ici

  • Editeur de script externe: code
    • code fait référence au chemin / usr / bin / code, l'exécutable de vscode
  • Arguments de l'éditeur de script externe: "$ (ProjectPath)" -g "$ (File)": $ (Line): $ (Column)
    • valeur par défaut, je n'ai rien changé

J'ai créé un simple script c # à partir de unity, j'ai ouvert le fichier et vscode s'est ouvert automatiquement (ouais!). Et à partir de vscode, j'ai ajouté deux variables publiques (le bool 'a' et le Rigidbody2D 'b')

entrez la description de l'image ici

J'ai sauvegardé mon script et je vais sur l'app unity, les variables a et b sont visibles sur l'interface:

entrez la description de l'image ici

Tout fonctionne! Mais maintenant, je veux avoir le code de saisie semi-automatique de vscode. J'ai donc installé les extensions vscode c #. Mais lorsque l'installation est terminée, ce message apparaît:

entrez la description de l'image ici

L'ensemble du journal est:

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

Quelque chose semble ne pas fonctionner ... Cependant, je peux modifier et enregistrer mon script c # (ajouter une nouvelle var publique par exemple, la variable est ajoutée dans l'interface unitaire), mais le code de saisie semi-automatique ne fonctionne pas, lorsque je tape public Rigidbod et appuyez sur ctrl + space , aucune aide de saisie semi-automatique n'est affichée.

Je ne suis pas familier avec les technologies C # / vscode / microsoft, je préfère demander ici si j'oublie quelque chose et / ou fait quelque chose de mal avant d'essayer (mauvaises) solutions

Merci pour votre aide!

EDIT: Je viens de notifier cette erreur sur l'interface unity3D

entrez la description de l'image ici

Je vais faire quelques recherches sur cette erreur ...

EDIT après la réponse 0xBFE1A8:

  • J'ai créé un nouveau projet 'plop'
  • Dans UnityEditor, j'ai changé la version de Visual Studio Code Editor en 1.1.3 et cliquez sur le bouton 'Update 1.1.3'

l'erreur ne disparaît pas, alors j'ai continué:

  • J'ai modifié le "com.unity.ide.vscode" en 1.1.3 dans "Packages / manifest.json"
  • Dans UnityEditor, la case "Générer tous les fichiers .csproj" est cochée
  • Et puis, je clique sur 'Réimporter tout' dans le menu Actifs

Après tout cela, le code de saisie semi-automatique dans vsecode ne fonctionne pas mais le journal des erreurs est plus petit:

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


0 commentaires

3 Réponses :


3
votes

Cet avertissement est un bogue connu de Visual Studio Code Editor 1.1.4 . Selon ces informations , c'est l'extension Omnisharp qui est à l'origine de l'erreur:

Ce problème est causé par une extension, veuillez le déposer auprès du référentiel (ou contact) que l'extension a lié dans sa présentation dans VS Code ou sur le marché pour VS Code. Consultez également nos consignes de signalement des problèmes.

Bon codage!

Pour moi, le passage à la version 1.1.3 du package a résolu les problèmes.

Dans UnityEditor, allez dans: [Window] -> [Package manager] -> [Visual Studio Code Editor] ->: Sélectionnez la version 1.1.3 et cliquez sur le bouton "Update 1.1.3".

entrez la description de l'image ici

Si les erreurs ne disparaissent pas après cela:

  • 1) Changé "com.unity.ide.vscode": "1.1.3" dans "Packages / manifest.json"
  • 2) Dans UnityEditor, allez dans: [Edition] -> [Préférences] -> [Outils externes]: Réglez la case à cocher " Générer tous les fichiers .csproj " sur true.
  • 3) Dans UnityEditor, accédez à: [Assets] -> [Reimport All]

Certaines personnes disent que si vous passez à la version 1.1.3 et juste après la mise à niveau vers la version 1.2.0, les erreurs devraient être corrigées, mais je ne l'ai pas essayé.


5 commentaires

merci pour votre aide détaillée :) J'ai créé un nouveau projet et je suis toutes vos étapes, le journal des erreurs est plus petit mais je garde l'erreur "Impossible de charger le fichier projet '/ home / okli / UnityProjects / plop / Assembly-CSharp. csproj '. " ... "/home/okli/.vscode/extensions/ms-dotnettools.csharp-1.21.16‌ /.omnisharp/1.34.15/‌ omnisharp / .msbuild / C‌ urrent / Bin / Microsoft‌ .Common. CurrentVersi‌ on.targets (1193,5): Erreur: les assemblys de référence pour .NETFramework, Version = v4.7.1 sont introuvables. Pour résoudre ce problème, installez le Developer Pack (SDK / Targeting Pack) pour cette version du framework ou recibler. .. ". Je mettrai à jour le message principal


Quelle est votre version mono?


J'ai la version 5.18.0.240 (sortie détaillée ici: i.ibb.co/9NGqhW3/Screenshot-from-2020-04-05-19-52-04.png ). J'ai installé mono via un simple sudo apt install mono-devel ( mono-project.com/docs/getting-started/install/linux )


Essayez de mettre à jour vers la dernière version stable .


C'est bon ! la version mono a le problème: D la saisie semi-automatique fonctionne comme un charme, merci pour votre aide et votre patience;)



0
votes

J'ai eu le même problème, mais je n'avais aucun rapport avec la MonoVersion. La mise à niveau vers la version 1.1.3 et la génération des fichiers csproj ont fait le travail. Je l'ai trouvé étrange car cette erreur est liée à la version 1.1.4 et j'ai commencé à étudier plus en détail la version 1.2.1 de l'extension vscode. Le problème était dans le fichier sln et j'ai trouvé une solution simple.

Dans UnityEditor, allez dans: [Edition] -> [Préférences] -> [Outils externes] : Cliquez sur la case à cocher pour Générer des fichiers .csproj pour: Paquets incorporés , puis sur le bouton Régénérer les fichiers de projet pour résoudre le problème d' auto-complétion .

entrez la description de l'image ici

Il a ajouté quelques lignes au fichier sln et la saisie semi-automatique fonctionne désormais sans avoir besoin de rétrograder l'extension.

J'espère que cela aide!


0 commentaires

0
votes

Si la complétion automatique de vscode unity ne fonctionne pas, installez une ancienne version de c # extensio, en cliquant sur le bouton de configuration


0 commentaires