简体   繁体   English

Visual Studio 代码不会自动完成我的 C# 代码

[英]Visual Studio Code Won't auto complete my C# code

SOLVED解决了

Just to clarify this is about VS code not just VS只是为了澄清这是关于VS 代码而不仅仅是VS

I've had the worst 3 hours looking for anything that could possibly fix my Visual studio code.我花了最糟糕的 3 个小时来寻找任何可能修复我的 Visual Studio 代码的东西。 I'm using the program to develop a game on unity but I can't seem to get the auto complete thing (I think its Intellisense) to auto complete my code causing spelling mistakes and making coding 10x longer than it needs to take.我正在使用该程序开发一个统一的游戏,但我似乎无法让自动完成的东西(我认为它的 Intellisense)自动完成我的代码,导致拼写错误并使编码比需要的时间长 10 倍。

Heres a list of things I have tried:这是我尝试过的事情的清单:

  • Install.Net Framework v4.7.1 (which is what the console says to do) Install.Net Framework v4.7.1(这是控制台所说的)
  • Fix the Assembly file made by unity multiple time修复unity多次生成的Assembly文件
  • Reinstall Visual studio, C# plugin and.Netframework重新安装Visual Studio,C#插件和.Netframework
  • Change the OmniSharp to the latest version将 OmniSharp 更改为最新版本

I will add that when ever I type anything it comes up with "[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService Could not find document for file c:\Users\Bruhman\Grinder\Assets\Scripts\PlayerMovement.cs" and when I open visual studios and write anything in the script it'll come up with an error that states "Some Projects have trouble loading. "Source: C# (Extension)" "我会补充一点,当我输入任何内容时,它会出现“[info]:OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService 找不到文件 c:\Users\Bruhman\Grinder\Assets\Scripts\PlayerMovement 的文档。 cs” ,当我打开 Visual Studio 并在脚本中编写任何内容时,它会出现一个错误,指出“某些项目无法加载。”来源:C#(扩展)“”

Below is a screen shot of what comes up in the console (It's the same every time)下面是控制台中出现的屏幕截图(每次都一样)

Console安慰

Never Mind I found out the issue, apparently I need to install Visual Studios Community version and then the.Net developer packs from visual studios and not just online, I'm assuming that it doesn't get detected or something when installed through the exe file...没关系,我发现了这个问题,显然我需要安装 Visual Studios Community 版本,然后从 Visual Studios 而不仅仅是在线安装.Net 开发人员包,我假设通过 exe 安装时没有检测到它或其他东西文件...

I don't really know much, but I use it every day: have you tried the unity tools extension?我不是很了解,但我每天都在使用它:您尝试过统一工具扩展吗?

It features a lot and also the c# auto completion.它功能很多,还有 c# 自动完成功能。

If it still bugs, have you installed the.Net for the EXACT version.如果它仍然存在错误,您是否安装了 EXACT 版本的.Net。 I also struggled because I had the upper version and not the exact.我也很挣扎,因为我有更高的版本而不是确切的版本。

Finally is it linked with unity (I don't know if it could interfere if not done)最后是和统一联系在一起吗(不知道会不会干扰)

Sorry I don't know anything else if this don't work.抱歉,如果这不起作用,我不知道其他任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM