0

I created an empty project and a C# script file .When I tried to open script in vs code project loading failed.

This is my Omnisharp Output. `

    Starting OmniSharp server at 12/17/2022, 8:14:59 AM
        Target: f:\BarryAllen14\Unity Projects\My project\My project.sln
     
    OmniSharp server started.
        Path: c:\Users\SMME\.vscode\extensions\ms-dotnettools.csharp-1.25.2-win32-x64\.omnisharp\1.39.2\OmniSharp.exe
        PID: 8820
     
    [info]: OmniSharp.Stdio.Host
            Starting OmniSharp on Windows 6.2.9200.0 (x64)
    [info]: OmniSharp.Services.DotNetCliService
            Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
    [info]: OmniSharp.Services.DotNetCliService
            Using the 'dotnet' on the PATH.
    [info]: OmniSharp.Services.DotNetCliService
            DotNetPath set to dotnet
    [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
            Located 1 MSBuild instance(s)
                1: Visual Studio Build Tools 2022 17.4.33205.214 17.4.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
    [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
            Registered MSBuild instance: Visual Studio Build Tools 2022 17.4.33205.214 17.4.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
    [info]: OmniSharp.WorkspaceInitializer
            Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    [info]: OmniSharp.Cake.CakeProjectSystem
            Detecting Cake files in 'f:\BarryAllen14\Unity Projects\My project'.
    [info]: OmniSharp.Cake.CakeProjectSystem
            Did not find any Cake files
    [info]: OmniSharp.MSBuild.ProjectSystem
            Detecting projects in 'f:\BarryAllen14\Unity Projects\My project\My project.sln'.
    [info]: OmniSharp.MSBuild.ProjectManager
            Queue project update for 'f:\BarryAllen14\Unity Projects\My project\Assembly-CSharp.csproj'
    [info]: OmniSharp.Script.ScriptProjectSystem
            Detecting CSX files in 'f:\BarryAllen14\Unity Projects\My project'.
    [info]: OmniSharp.Script.ScriptProjectSystem
            Did not find any CSX files
    [info]: OmniSharp.WorkspaceInitializer
            Configuration finished.
    [info]: OmniSharp.Stdio.Host
            Omnisharp server running using Stdio at location 'f:\BarryAllen14\Unity Projects\My project' on host 16560.
    [info]: OmniSharp.MSBuild.ProjectManager
            Loading project: f:\BarryAllen14\Unity Projects\My project\Assembly-CSharp.csproj
    [info]: OmniSharp.MSBuild.ProjectManager
            Successfully loaded project file 'f:\BarryAllen14\Unity Projects\My project\Assembly-CSharp.csproj'.
    [info]: OmniSharp.MSBuild.ProjectManager
            Adding project 'f:\BarryAllen14\Unity Projects\My project\Assembly-CSharp.csproj'
    [info]: OmniSharp.MSBuild.ProjectManager
            Update project: Assembly-CSharp

** This is my Assembly-CSharp.csproj file.**

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <LangVersion>9.0</LangVersion>
      </PropertyGroup>
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>10.0.20506</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <RootNamespace></RootNamespace>
        <ProjectGuid>{e6bdc332-25e1-2831-82c1-25d0441455a3}</ProjectGuid>
        <OutputType>Library</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <AssemblyName>Assembly-CSharp</AssemblyName>
        <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
        <FileAlignment>512</FileAlignment>
        <BaseDirectory>.</BaseDirectory>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>Temp\bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE;UNITY_2021_3_16;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <NoWarn>0169</NoWarn>
        <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
      </PropertyGroup>
      <PropertyGroup>
        <NoConfig>true</NoConfig>
        <NoStdLib>true</NoStdLib>
        <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
        <ImplicitlyExpandNETStandardFacades>false</ImplicitlyExpandNETStandardFacades>
        <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
      </PropertyGroup>
      <ItemGroup>
         <Compile Include="Assets\abc.cs" />
        <Reference Include="UnityEngine">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.AIModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.ARModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.AccessibilityModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.AndroidJNIModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.AnimationModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.AssetBundleModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.AudioModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.ClothModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.ClusterInputModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll</HintPath>
        </Reference>
        <Reference Include="UnityEngine.ClusterRendererModule">
            <HintPath>C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngineth>
        </Reference>




        <Reference Include="Unity.VisualScripting.Core">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.VisualScripting.Core.dll</HintPath>
        </Reference>
        <Reference Include="Unity.EditorCoroutines.Editor">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.EditorCoroutines.Editor.dll</HintPath>
        </Reference>
        <Reference Include="Unity.Services.Core.Analytics">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.Services.Core.Analytics.dll</HintPath>
        </Reference>
        <Reference Include="Unity.VisualScripting.Shared.Editor">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.VisualScripting.Shared.Editor.dll</HintPath>
        </Reference>
        <Reference Include="Unity.Services.Core.Environments">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.Services.Core.Environments.dll</HintPath>
        </Reference>
        <Reference Include="Unity.Timeline.Editor">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.Timeline.Editor.dll</HintPath>
        </Reference>
        <Reference Include="Unity.TestTools.CodeCoverage.Editor">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.dll</HintPath>
        </Reference>
        <Reference Include="Unity.VisualScripting.State">
            <HintPath>F:\BarryAllen14\Unity Projects\My project\Library\ScriptAssemblies\Unity.VisualScripting.State.dll</HintPath>
        </Reference>
      </ItemGroup>
      <ItemGroup>
      </ItemGroup>
      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
      <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
           Other similar extension points exist, see Microsoft.Common.targets.
      <Target Name="BeforeBuild">
      </Target>
      <Target Name="AfterBuild">
      </Target>
      -->
    </Project>
     

` when I click Project loading Failed at the bottom of the screen. Assembly-CSharp.csproj status file opens with following text. enter image description here.

This happens with every project I create both new one and old one. Originally I was following pathway from my unity learn, when i treid to use **onTriggerEnter **function vscode didnt autocomplete it, so manually typed it. But i didnt work like it is supposed to. vscode was treating it as user defined build function not as monobehaviour function. I searched for possible reasons on unity forums, stack exchange and reddit but none of the solution worked for me. So uninstalled Unity, VScode and .net frameworks. And installed everyth from scratch following these two guides.

https://code.visualstudio.com/docs/other/unity https://code.visualstudio.com/docs/languages/dotnet

Now my freshly installed Unity and VScode is not even loading project properly.

My 2 days has been wasted. plz help me.

I also psoted the same thing in unity forum and according to replies this is problem is more likely due to vscode not unity editor.

rioV8
  • 24,506
  • 3
  • 32
  • 49

0 Answers0