2_Terminal_Hacker | basic state machines | Game Engine library
kandi X-RAY | 2_Terminal_Hacker Summary
kandi X-RAY | 2_Terminal_Hacker Summary
This is the Complete Unity C# Developer 3D, the long-awaited sequel to the Complete Unity C# Developer 2D - one of the most successful e-learning courses on the internet! Completely re-worked from scratch with brand-new projects, our latest teaching techniques,. You will benefit from the fact we have already taught over 350,000 students game development, many shipping commercial games as a result. You're welcome to download, fork or do whatever else legal with all the files! The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: Complete Unity C# Developer 3D.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of 2_Terminal_Hacker
2_Terminal_Hacker Key Features
2_Terminal_Hacker Examples and Code Snippets
Community Discussions
Trending Discussions on 2_Terminal_Hacker
QUESTION
I am trying to get vscode to enable c# code completion with unity, as this guide shows. I had a problem earlier that for some reason the .NET targeting pack was installed but the SDK was not, which someone was able to help me with. However, I am still getting errors that say the reference assemblies cannot be found. I have re-installed the developer pack, the .NET SDK and targeting pack, restarted my computer, and uninstalled/ reinstalled extensions. The logs say I might have to retarget the application but that is very vague and I cannot find any guides on how to do that. Thanks for your help.
EDIT: I have tried changing the target framework to 4.8, but omnisharp has the same error log with a different version that I also installed. Could this be a problem with having multiple drives?
.csproj target framework:
v4.7.1
Omnisharp error log:
...Starting OmniSharp server at 5/31/2020, 7:56:50 PM Target: a:\Github\Unity\2_Terminal_Hacker\2_Terminal_Hacker.sln
OmniSharp server started. Path: c:\Users\0dps1.vscode\extensions\ms-dotnettools.csharp-1.22.0.omnisharp\1.35.2\OmniSharp.exe PID: 5544
[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 2 MSBuild instance(s) 1: Visual Studio Community 2019 16.6.30114.105 - "A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" 2: StandAlone 16.4 - "c:\Users\0dps1.vscode\extensions\ms-dotnettools.csharp-1.22.0.omnisharp\1.35.2.msbuild\Current\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio Community 2019 16.6.30114.105 - "A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'a:\Github\Unity\2_Terminal_Hacker'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem Detecting projects in 'a:\Github\Unity\2_Terminal_Hacker\2_Terminal_Hacker.sln'. [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'a:\Github\Unity\2_Terminal_Hacker'. [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: a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.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 'a:\Github\Unity\2_Terminal_Hacker' on host 4260. [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 'a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj'. a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,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: a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj
ANSWER
Answered 2020-Jun-01 at 23:45https://docs.microsoft.com/en-us/dotnet/standard/frameworks
If you open .csproj files you will see "TargetFramework" tag, and inside it, one of the possible values from the link. "Retarget" means changing "Target Framework" value from "net471" to, say, "net46".
Unfortunately, since this is Unity project, Unity likes to have full control of the content of the csproj files, and any changes you make will be only temporary. So you may retarget to something and make the error go away, but Unity will revert this to "net471" on its whim later.
Your options are:
Fix .net sdk /vscode installation so you get the targetting pack. You may try to open the solution in VS community and maybe it will offer a fix from the UI
Unity has an inbuilt dropdown in player settings to target net2 or something like that instead of net471, but thats a really ancient version of c#/net. It might have been completely deprecated recently.
Do hacks to inject yourself in unity csproj generation so it always use some version you have (not recommended)
EDIT - yes, it's actually very possible it's multiple drive issue. I see from your logs that Visual Studio Community is installed on A:\drive. Reference assemblies are usually found in "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework". So it's very likely that where MSBuild.exe is looking for those and where the targetting pack is actually installed are mismatched.
Don't really have any idea how to fix this other than trying to install VS in default location on C:\ - probably there are some magic environment variables that can be set to trigger MSBuild to look in the right place.
QUESTION
I am having trouble getting the .net framework to run inside vscode. I can get the .net framework running fine when I open vscode normally. However, when I open a .cs file in unity and use vscode as my default editor, I get error messages because the .net framework no longer works inside vscode. I need the framework for c# specific autocomplete and syntax errors. I have gotten comments on another post that has been closed saying I need to be more specific about this issue. This is not an issue with unity not supporting the .net framework. I have tried restarting my pc, restarting vscode, restarting unity, reimporting unity packages, and redownloading the .net framework. All c# code runs fine inside and outside of unity regardless of whether vscode was launched using the unity shortcut, but running the dotnet command and any c# related autocomplete/syntax do not work. I can edit c# code from unity by running vscode without unity and navigating to the file. Thanks for your help.
dotnet command run in vscode launched by unity
dotnet command run in vscode launched via shortcut
c# code working inside of unity
Omnisharp error message/log:
...Starting OmniSharp server at 5/30/2020, 9:41:51 PM Target: a:\Github\Unity\2_Terminal_Hacker\2_Terminal_Hacker.sln
OmniSharp server started. Path: c:\Users\0dps1.vscode\extensions\ms-dotnettools.csharp-1.22.0.omnisharp\1.35.2\OmniSharp.exe PID: 15076
[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 2 MSBuild instance(s) 1: Visual Studio Community 2019 16.6.30114.105 - "A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" 2: StandAlone 16.4 - "c:\Users\0dps1.vscode\extensions\ms-dotnettools.csharp-1.22.0.omnisharp\1.35.2.msbuild\Current\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio Community 2019 16.6.30114.105 - "A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'a:\Github\Unity\2_Terminal_Hacker'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem Detecting projects in 'a:\Github\Unity\2_Terminal_Hacker\2_Terminal_Hacker.sln'. [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'a:\Github\Unity\2_Terminal_Hacker'. [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: a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.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 'a:\Github\Unity\2_Terminal_Hacker' on host 13388. [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 'a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj'. a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,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: a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj
ANSWER
Answered 2020-May-31 at 22:19The answer is in the log:
[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 'a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj'. a:\Github\Unity\2_Terminal_Hacker\Assembly-CSharp.csproj A:\Program Files\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,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
.Net sdk/system libraries are installed through Visual Studio, so vscode/omnisharp tried to pull them from your Visual Studio Community 16.6 installation (info for that is on the start of the log). But it looks like VSCommunity is installed without v4.7.1 targetting pack.
To fix this, go to:
Visual Studio Installer -> Visual Studio Community -> More -> Modify -> Individual Components
and check ".NETFramework v4.7.1" pack. Afrer this gets installed, reboot stuff and you should be good to go.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install 2_Terminal_Hacker
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page